時(shí)間:2024-02-14 10:20作者:下載吧人氣:22
MongoDB是一個(gè)NoSQL數(shù)據(jù)庫(kù)系統(tǒng):一個(gè)數(shù)據(jù)庫(kù)可以包含多個(gè)集合(Collection),每個(gè)集合對(duì)應(yīng)于關(guān)系數(shù)據(jù)庫(kù)中的表;而每個(gè)集合中可以存儲(chǔ)一組由列標(biāo)識(shí)的記錄,列是可以自由定義的,非常靈活,由一組列標(biāo)識(shí)的實(shí)體的集合對(duì)應(yīng)于關(guān)系數(shù)據(jù)庫(kù)表中的行。下面通過熟悉MongoDB的基本管理命令,來了解MongoDB提供的DBMS的基本功能和行為。
MongoDB命令幫助系統(tǒng)
在安裝MongoDB后,啟動(dòng)服務(wù)器進(jìn)程(mongod),可以通過在客戶端命令mongo實(shí)現(xiàn)對(duì)MongoDB的管理和監(jiān)控。看一下MongoDB的命令幫助系統(tǒng):
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
網(wǎng)友評(píng)論