Help show helpshow DBS show database namesshow collections show collections in current databaseshow users show users in current databaseshow profile show most recent system. profile entries with time> = 1 msuse <dB Name> set curent database to <dB Name> dB. adduser (username, password) dB. removeuser (username) dB. clonedatabase (fromhost) dB. copydatabase (fromdb, todb, fromhost) dB. createcollection (name, {size :..., capped :..., MAX :...}) DB. getname () dB. dropdatabase () // Runs the collstats] command on each collection in the database DB. printcollectionstats () dB. currentop () displays the current operation in the dbdb. killop () kills the current operation in the dbdb. getprofilinglevel () dB. setprofilinglevel (level) 0 = off 1 = slow 2 = alldb. getreplicationinfo () dB. printreplicationinfo () dB. printslavereplicationinfo () dB. repairdatabase () dB. version () Current version of The serverdb. shutdownserver ()
DB. Foo. Drop () Drop the collection
DB. Foo. dropindex (name)
DB. Foo. dropindexes ()
DB. Foo. getindexes ()
DB. Foo. ensureindex (keypattern, options)-options object has these possible
Fields: name, unique, dropdups
DB. Foo. Find ([query], [fields])-First parameter is an optional
Query filter. Second Parameter
Is optional
Set of fields to return.
E.g. DB. Foo. Find (
{X: 77 },
{Name: 1, x: 1 })
DB. Foo. Find (...). Count ()
DB. Foo. Find (...). Limit (N)
DB. Foo. Find (...). Skip (N)
DB. Foo. Find (...). Sort (...)
DB. Foo. findone ([query])
DB. Foo. getdb () Get dB object associated with collection
DB. Foo. Count ()
DB. Foo. Group ({key:..., initial:..., reduce:... [, Cond:...]})
DB. Foo. renamecollection (newname) renames the collection
DB. Foo. Stats ()
DB. Foo. datasize ()
DB. Foo. storagesize ()-includes free space allocated to this collection
DB. Foo. totalindexsize ()-size in bytes of all the indexes
DB. Foo. totalsize ()-storage allocated for all data and Indexes
DB. Foo. Validate () (slow)
DB. Foo. insert (OBJ)
DB. Foo. Update (query, object [, upsert_bool])
DB. Foo. Save (OBJ)
DB. Foo. Remove (query)-remove objects matching Query
Remove ({}) will remove all