MongoDB插入查询数据(二), 条件查询
程序员文章站
2022-05-02 13:03:45
...
db.things.find({name:"mongo" }).forEach(printjson);{ "_id" : ObjectId("501c7e5cab2f3c46faf8e68a"), "name" : "mongo" } 相当于 SELECT * FROM things WHERE . 里指定元素的名字 SELECT name FROM things WHERE db.things.find({name:"mongo"}, {name:
> db.things.find({name:"mongo"}).forEach(printjson); { "_id" : ObjectId("501c7e5cab2f3c46faf8e68a"), "name" : "mongo" }
相当于SELECT * FROM things WHERE