db.collection.insertOne()
db.collection.insertMany()
db.fruits.insertOne({name:"apple"}) db.fruits.insertMany([ {name:"apple"}, {name:"pear"} ])
单条件查询:db.movies.find({"year":1997})
多条件与查询:
db.movies.find({"year":1997,"type":"action"})
或 db.movies.find({$and:[{"year":1997}, {"type":"action"}]})
多条件或查询:
db.movies.find({$or:[{"year":1997},{"type":"action"}]})
正则表达式查询:
db.movies.find({"title":/^B/})