【发布时间】:2018-02-07 21:59:35
【问题描述】:
如果我有一个 mongodb 数据库,是否可以:
db.mydb.find(...)
这样结果会过滤掉任何可能存在的子文档,而事先不知道它们是什么?
例如,如果我有:
{ "_id" : ObjectId("..."), "name" : "george", "address" : { "street" : "101 example way", "city" : "tutorial", "state" : "CA" }, "other thing" : "thing value" }
我可以将哪些参数传递给 find() 以获取:
{ "_id" : ObjectId("..."), "name" : "george", "other thing" : "thing value" }
无需指定:
db.mydbl.find( {}, { "address" : 0} )
是否存在抑制所有子文档的方法?
【问题讨论】:
标签: mongodb nosql mongodb-query