私はmongoDBにこの構造を持つドキュメントのコレクションを持っています:
{ _id: ObjectId("50f970caaa070bb8150000ae"), 通称:「アルゼンチン」、 ポブラシオン: 1000, 州: [ { 通称:「ブエノスアイレス」、 知事: "ホルヘ・ルイス", cantMedicos: 2, _id: ObjectId("50f970caaa070bb8150000a9") }、 { 通称:「カタマルカ」、 知事: "Rodrigo Neira", カントメディコス: 5, _id: ObjectId("50f970caaa070bb8150000aa") } ] }
親の「名前」が「アルゼンチン」に等しいすべての「州」からフィールド「gobernador」を出力したいと思います。しかし、PHPでこれを達成する方法が見つかりません。