[SERVER-17347] .explain() should be included in the shell's DBCollection help Created: 23/Feb/15  Updated: 19/Sep/15  Resolved: 23/Feb/15

Status: Closed
Project: Core Server
Component/s: Shell, Usability
Affects Version/s: None
Fix Version/s: 3.0.1, 3.1.0

Type: Improvement Priority: Minor - P4
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-10448 Revamp explain() formatting Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Participants:

 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



 Comments   
Comment by Githook User [ 03/Mar/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-17347 add help text for DBCollection's explain method

(cherry picked from commit 03f9a5bd9758a28bf48be06fe45bf201a978814e)
Branch: v3.0
https://github.com/mongodb/mongo/commit/2079db4e4e9f8dea3f84cd28359f4c12be3dd042

Comment by Githook User [ 23/Feb/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-17347 add help text for DBCollection's explain method
Branch: master
https://github.com/mongodb/mongo/commit/03f9a5bd9758a28bf48be06fe45bf201a978814e

Generated at Thu Feb 08 03:44:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.