Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-17347

.explain() should be included in the shell's DBCollection help

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.1, 3.1.0
    • Component/s: Shell, Usability
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Completed:

      Description

      This output should mention DBCollection's new explain method:

      > db.coll.help()
      DBCollection help
      	db.coll.find().help() - show DBCursor help
      	db.coll.count()
      	db.coll.copyTo(newColl) - duplicates collection by copying all documents to newColl; no indexes are copied.
      	db.coll.convertToCapped(maxBytes) - calls {convertToCapped:'coll', size:maxBytes}} command
      	db.coll.dataSize()
      	db.coll.distinct( key ) - e.g. db.coll.distinct( 'x' )
      	db.coll.drop() drop the collection
      	db.coll.dropIndex(index) - e.g. db.coll.dropIndex( "indexName" ) or db.coll.dropIndex( { "indexKey" : 1 } )
      	db.coll.dropIndexes()
      	db.coll.ensureIndex(keypattern[,options])
      	db.coll.reIndex()
      	db.coll.find([query],[fields]) - query is an optional query filter. fields is optional set of fields to return.
      	                                              e.g. db.coll.find( {x:77} , {name:1, x:1} )
      	db.coll.find(...).count()
      	db.coll.find(...).limit(n)
      	db.coll.find(...).skip(n)
      	db.coll.find(...).sort(...)
      	db.coll.findOne([query])
      	db.coll.findAndModify( { update : ... , remove : bool [, query: {}, sort: {}, 'new': false] } )
      	db.coll.getDB() get DB object associated with collection
      	db.coll.getPlanCache() get query plan cache associated with collection
      	db.coll.getIndexes()
      	db.coll.group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )
      	db.coll.insert(obj)
      	db.coll.mapReduce( mapFunction , reduceFunction , <optional params> )
      	db.coll.aggregate( [pipeline], <optional params> ) - performs an aggregation on a collection; returns a cursor
      	db.coll.remove(query)
      	db.coll.renameCollection( newName , <dropTarget> ) renames the collection.
      	db.coll.runCommand( name , <options> ) runs a db command with the given name where the first param is the collection name
      	db.coll.save(obj)
      	db.coll.stats({scale: N, indexDetails: true/false, indexDetailsKey: <index key>, indexDetailsName: <index name>})
      	db.coll.storageSize() - includes free space allocated to this collection
      	db.coll.totalIndexSize() - size in bytes of all the indexes
      	db.coll.totalSize() - storage allocated for all data and indexes
      	db.coll.update(query, object[, upsert_bool, multi_bool]) - instead of two flags, you can pass an object with fields: upsert, multi
      	db.coll.validate( <full> ) - SLOW
      	db.coll.getShardVersion() - only for use with sharding
      	db.coll.getShardDistribution() - prints statistics about data distribution in the cluster
      	db.coll.getSplitKeysForChunks( <maxChunkSize> ) - calculates split points over all chunks and returns splitter function
      	db.coll.getWriteConcern() - returns the write concern used for any operations on this collection, inherited from server/db if set
      	db.coll.setWriteConcern( <write concern doc> ) - sets the write concern for writes to the collection
      	db.coll.unsetWriteConcern( <write concern doc> ) - unsets the write concern for writes to the collection

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: