查询MongoDB中的数组

时间:2018-01-29 11:34:24

标签: mongodb

测试数据

db.multiArr.insert({"ID" : "fruit1","Keys" : ["carrot", "banana"]})
db.multiArr.insert({"ID" : "fruit2","Keys" : ["apple", "orange"]})
db.multiArr.insert({"ID" : "fruit2","Keys" : ["apple"]})

如何在[“apple”,“other”]中查询键? 需要

 ({"ID" : "fruit2","Keys" : ["apple"]})

感谢。

0 个答案:

没有答案