List of available commands in MongoDB

Following are the list of commands available in MongoDB.

Command Usage help on db methods help on collection methods sharding helpers replica set helpers
help admin administrative help
help connect connecting to a db help
help keys key shortcuts
help misc misc things to know
help mr mapreduce
show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
show logs show the accessible logger names
show log [name] prints out the last segment of log in memory
use set current database list objects in collection foo { a : 3 } ) list objects in foo where a == 3
it result of the last line evaluated
DBQuery.shellBatchSize = x set default number of items to display on shell
exit quit the mongo shell
Ctrl A Start of line
Ctrl E End of the line
Ctrl K del to end of the line


> show dbs
local 0.000GB
> use local
switched to db local
> use test
switched to db test

Related Posts

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: