1、幫助
help
KEYWORDS.help()
KEYWORDS.[TAB]
db.
rs.
sh.
show
use
db.help()
db.a.help()
rs.help()
sh.help()
2、常用操作
查看當前db版本
test> db.version()
顯示當前數據庫
test> db
test
或
> db.getName()
test
查詢所有數據庫
test> show dbs
local 0.000GB
切換數據庫
> use local
switched to db local
顯示當前數據庫狀態
test> use local
switched to db local
local> db.stats()
查看當前數據庫的連接機器地址
> db.getMongo()
connection to 127.0.0.1
指定數據庫進行連接
默認連接本機test數據庫