Get a list of databases

show dbs

example

local (empty)
test (empty)
wemeter 39.9345703125GB

Get the version of the server

db.version()

Change a database

use wemeter

Get statistics about the curret database

db.stats()

example

{
"db" : "wemeter",
"collections" : 9,
"objects" : 56459660,
"avgObjSize" : 273.4919290693568,
"dataSize" : 15441261328,
"storageSize" : 17210994656,
"numExtents" : 79,
"indexes" : 28,
"indexSize" : 19360473664,
"fileSize" : 42862641152,
"nsSizeMB" : 16,
"ok" : 1
}

Connect to an external server

mongo mongo.servername.com

or

mongo 123.456.789.123

Leave a Reply

Your email address will not be published. Required fields are marked *