【发布时间】:2014-02-07 11:47:39
【问题描述】:
这是我的 mongo 文档,如何在 PHP 中获取 hud 到 $_id = ("52ee9fef94ffc1f7a0dd0a55") 的对象或数组?
"_id" : ObjectId("52ee9fef94ffc1f7a0dd0a55"),
"lvl" : 2,
"required_xp" : 100,
"rewards" : {
"hud" : [
{
"type" : "food",
"amount" : 50
},
{
"type" : "soft",
"amount" : 100
}
],
"inventory" : [
{
"id" : 24,
"amount" : 1
}
]
},
"xp_next_lvl" : 110
【问题讨论】:
-
我试图更好地理解这个问题。您想知道如何通过 id 从您的集合中选择特定文档吗?
标签: php arrays mongodb-php