help KEYWORDS.help() KEYWORDS.[TAB] db. rs. sh. show use db.help() db.a.help() rs.help() sh.help()
查看當前db版本shell
test> db.version()
顯示當前數據庫數據庫
test> db test
或ide
> db.getName() test
查詢全部數據庫code
test> show dbs local 0.000GB
切換數據庫get
> use local switched to db local
顯示當前數據庫狀態it
test> use local switched to db local local> db.stats()
查看當前數據庫的鏈接機器地址io
> db.getMongo() connection to 127.0.0.1
指定數據庫進行鏈接
默認鏈接本機test數據庫class