summaryrefslogtreecommitdiff
path: root/shell/collection.js
diff options
context:
space:
mode:
Diffstat (limited to 'shell/collection.js')
-rw-r--r--shell/collection.js76
1 files changed, 38 insertions, 38 deletions
diff --git a/shell/collection.js b/shell/collection.js
index eca3d378b7c..bdd8fe3027e 100644
--- a/shell/collection.js
+++ b/shell/collection.js
@@ -24,44 +24,44 @@ DBCollection.prototype.verify = function(){
DBCollection.prototype.getName = function(){
return this._shortName;
-}
-
-DBCollection.prototype.help = function () {
- var shortName = this.getName();
- print("DBCollection help");
- print("\tdb." + shortName + ".find().help() - show DBCursor help");
- print("\tdb." + shortName + ".count()");
- print("\tdb." + shortName + ".dataSize()");
- print("\tdb." + shortName + ".distinct( key ) - eg. db." + shortName + ".distinct( 'x' )");
- print("\tdb." + shortName + ".drop() drop the collection");
- print("\tdb." + shortName + ".dropIndex(name)");
- print("\tdb." + shortName + ".dropIndexes()");
- print("\tdb." + shortName + ".ensureIndex(keypattern,options) - options should be an object with these possible fields: name, unique, dropDups");
- print("\tdb." + shortName + ".reIndex()");
- print("\tdb." + shortName + ".find( [query] , [fields]) - first parameter is an optional query filter. second parameter is optional set of fields to return.");
- print("\t e.g. db." + shortName + ".find( { x : 77 } , { name : 1 , x : 1 } )");
- print("\tdb." + shortName + ".find(...).count()");
- print("\tdb." + shortName + ".find(...).limit(n)");
- print("\tdb." + shortName + ".find(...).skip(n)");
- print("\tdb." + shortName + ".find(...).sort(...)");
- print("\tdb." + shortName + ".findOne([query])");
- print("\tdb." + shortName + ".findAndModify( { update : ... , remove : bool [, query: {}, sort: {}, 'new': false] } )");
- print("\tdb." + shortName + ".getDB() get DB object associated with collection");
- print("\tdb." + shortName + ".getIndexes()");
- print("\tdb." + shortName + ".group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )");
- print("\tdb." + shortName + ".mapReduce( mapFunction , reduceFunction , <optional params> )");
- print("\tdb." + shortName + ".remove(query)");
- print("\tdb." + shortName + ".renameCollection( newName , <dropTarget> ) renames the collection.");
- print("\tdb." + shortName + ".runCommand( name , <options> ) runs a db command with the given name where the 1st param is the colleciton name");
- print("\tdb." + shortName + ".save(obj)");
- print("\tdb." + shortName + ".stats()");
- print("\tdb." + shortName + ".storageSize() - includes free space allocated to this collection");
- print("\tdb." + shortName + ".totalIndexSize() - size in bytes of all the indexes");
- print("\tdb." + shortName + ".totalSize() - storage allocated for all data and indexes");
- print("\tdb." + shortName + ".update(query, object[, upsert_bool, multi_bool])");
- print("\tdb." + shortName + ".validate() - SLOW");
- print("\tdb." + shortName + ".getShardVersion() - only for use with sharding");
- return __magicNoPrint;
+}
+
+DBCollection.prototype.help = function () {
+ var shortName = this.getName();
+ print("DBCollection help");
+ print("\tdb." + shortName + ".find().help() - show DBCursor help");
+ print("\tdb." + shortName + ".count()");
+ print("\tdb." + shortName + ".dataSize()");
+ print("\tdb." + shortName + ".distinct( key ) - eg. db." + shortName + ".distinct( 'x' )");
+ print("\tdb." + shortName + ".drop() drop the collection");
+ print("\tdb." + shortName + ".dropIndex(name)");
+ print("\tdb." + shortName + ".dropIndexes()");
+ print("\tdb." + shortName + ".ensureIndex(keypattern,options) - options should be an object with these possible fields: name, unique, dropDups");
+ print("\tdb." + shortName + ".reIndex()");
+ print("\tdb." + shortName + ".find( [query] , [fields]) - first parameter is an optional query filter. second parameter is optional set of fields to return.");
+ print("\t e.g. db." + shortName + ".find( { x : 77 } , { name : 1 , x : 1 } )");
+ print("\tdb." + shortName + ".find(...).count()");
+ print("\tdb." + shortName + ".find(...).limit(n)");
+ print("\tdb." + shortName + ".find(...).skip(n)");
+ print("\tdb." + shortName + ".find(...).sort(...)");
+ print("\tdb." + shortName + ".findOne([query])");
+ print("\tdb." + shortName + ".findAndModify( { update : ... , remove : bool [, query: {}, sort: {}, 'new': false] } )");
+ print("\tdb." + shortName + ".getDB() get DB object associated with collection");
+ print("\tdb." + shortName + ".getIndexes()");
+ print("\tdb." + shortName + ".group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )");
+ print("\tdb." + shortName + ".mapReduce( mapFunction , reduceFunction , <optional params> )");
+ print("\tdb." + shortName + ".remove(query)");
+ print("\tdb." + shortName + ".renameCollection( newName , <dropTarget> ) renames the collection.");
+ print("\tdb." + shortName + ".runCommand( name , <options> ) runs a db command with the given name where the 1st param is the colleciton name");
+ print("\tdb." + shortName + ".save(obj)");
+ print("\tdb." + shortName + ".stats()");
+ print("\tdb." + shortName + ".storageSize() - includes free space allocated to this collection");
+ print("\tdb." + shortName + ".totalIndexSize() - size in bytes of all the indexes");
+ print("\tdb." + shortName + ".totalSize() - storage allocated for all data and indexes");
+ print("\tdb." + shortName + ".update(query, object[, upsert_bool, multi_bool])");
+ print("\tdb." + shortName + ".validate() - SLOW");
+ print("\tdb." + shortName + ".getShardVersion() - only for use with sharding");
+ return __magicNoPrint;
}
DBCollection.prototype.getFullName = function(){