花花世界蕾 发表于 2018-10-26 12:43:03

【MongoDB学习笔记14】MongoDB的查询:find基础

> db.post.find({"name":"joe"})  
{ "_id" : ObjectId("54a530c3ff0df3732bac1681"), "id" : 2, "name" : "joe", "age" : 30, "sex" : 1, "school" : "marry" }
  
{ "_id" : ObjectId("54a530c3ff0df3732bac1680"), "id" : 1, "name" : "joe", "age" : 30, "comments" : [ "test2", "test9", "test5" ], "sex" : 1, "school" : "marry" }
  
> db.post.find({"name":"joe","id":1})
  
{ "_id" : ObjectId("54a530c3ff0df3732bac1680"), "id" : 1, "name" : "joe", "age" : 30, "comments" : [ "test2", "test9", "test5" ], "sex" : 1, "school" : "marry" }
  
>


页: [1]
查看完整版本: 【MongoDB学习笔记14】MongoDB的查询:find基础