mongod --dbpath D:\software\MongoDB\Server\data\db
mongod -dbpath "D:\software\MongoDB\Server\data\db" -logpath "D:\software\MongoDB\Server\data\log\mongo.log" -install -serviceName "MongoDB"
https://www.cnblogs.com/zhoulifeng/p/9429597.html
show dbs
show databases
use 數(shù)據(jù)庫(kù)名
-不用創(chuàng)建數(shù)據(jù)庫(kù)或集合,在寫insert語(yǔ)句時(shí)自動(dòng)創(chuàng)建
db
-顯示當(dāng)前所在得數(shù)據(jù)據(jù)庫(kù)
show collections
-顯示數(shù)據(jù)庫(kù)所有的集合
數(shù)據(jù)庫(kù)的CRUD
向數(shù)據(jù)中插入文檔
db.<collection>.insert(doc)
db.stus.insert({name:"sunwukong",age:18,gender:"male"});
向stus集合中插入一個(gè)新的學(xué)生對(duì)象
db.<collection>.find()
db.stus.find()