1.show dbs 展示所有的數(shù)據(jù)庫

image.png
2.use 數(shù)據(jù)庫名字 沒有這個(gè)數(shù)據(jù)庫就自動創(chuàng)建

image.png
3. db.<collection>.insertOne({}) 創(chuàng)建一個(gè)集合名字往里面插入數(shù)據(jù)

image.png
4.查找當(dāng)前數(shù)據(jù)庫對應(yīng)集合的數(shù)據(jù)

image.png
5.更新刪除對應(yīng)數(shù)據(jù) db.<collections>.update({},{ $set:{}) 更新對應(yīng)數(shù)據(jù)|| db.<collections>.update({},{$unset:{}) 刪除對應(yīng)數(shù)據(jù)

image.png
6.專業(yè)的刪除數(shù)據(jù)deleltMany({})/deleteOne({})

image.png
總結(jié) 官網(wǎng)地址https://docs.mongodb.com/manual/crud/

image.png