時間:2024-02-14 10:20作者:下載吧人氣:14
MongoDB是一個NoSQL數據庫系統:一個數據庫可以包含多個集合(Collection),每個集合對應于關系數據庫中的表;而每個集合中可以存儲一組由列標識的記錄,列是可以自由定義的,非常靈活,由一組列標識的實體的集合對應于關系數據庫表中的行。下面通過熟悉MongoDB的基本管理命令,來了解MongoDB提供的DBMS的基本功能和行為。
MongoDB命令幫助系統
在安裝MongoDB后,啟動服務器進程(mongod),可以通過在客戶端命令mongo實現對MongoDB的管理和監控。看一下MongoDB的命令幫助系統:
root@dev:~# mongo
MongoDB shell version: ..
connecting to: test
> help
db.help() help on db methods
db.mycoll.help() help on collection methods
rs.help() help on replica set methods
help connect connecting to a db help
help admin administrative help
help misc misc things to know
help mr mapreduce help
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 >= ms
use <db_name> set current database
db.foo.find() list objects in collection foo
db.foo.find( { a : } ) list objects in foo where a ==
it result of the last line evaluated; use to further iterate
DBQuery.shellBatchSize = x set default number of items to display on shell
exit quit the mongo shell
網友評論