如何从RockMongo和PHP获取具有“test”:NumberInt(1000)属性的MongoDB文档?
我尝试了类似 {“items”:{“test”:1000}} ,但是
找不到记录。
Mongo集合示例:
{
"_id": ObjectId("xxx"),
"items": {
"0": {
"0": {
"test": NumberInt(1000)
}
},
"1": {
"test": NumberInt(2000)
},
},
},
{
"_id": ObjectId("yyy"),
"items": {
"0": {
"0": {
"test": NumberInt(3000)
}
},
"1": {
"test": NumberInt(4000)
},
}
}
答案 0 :(得分:1)
试试这个
db.coll.find( { 'items.test': 1000 } )
并确保items
是array
而不是object
。