mongodb
database server--存儲數據
databases--倉庫,對一類數據的抽象處理(eg洗發水) DB
collections--對一類數據的抽象處理,更細(eg去屑洗發水)RA/Table
documents--
fields--
常用
brew services start mongodb-community@4.2
mongo
show dbs :print all databases
use <db> :switch to exist db, create new db
db: print current db
show collections
db.{collection}.insertOne()
db.{collection}.insertMany()
db.{collection}.find()
db.{collection}.findOne()滿足條件第一條<=>db.students.find({age:{exists:1}}):age不為空 1/2/3/true
db.students.find({age:{set:{age:23}})
+2:
db.students.update({name:"bob"},{inc:{age:-5}})
取消某字段:
db.students.update({name:"bob"},{exsis:true}},{
exists:true}})