第 3 部分 MongoDB經常使用基本操做

一、幫助

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

相關文章
相關標籤/搜索