私はmongoDBが初めてで、十分な例を見ましたが、ほとんどがコレクションの操作方法を示しています。
DB名でmongoDBに保存されているデータをたどりましたmyDB
:
"_id" : "some_table_name",
"content" : [{
"id" : "1",
"loctype" : "Clinic/Hospital",
"locname" : "KKH"
}, {
"id" : "2",
"loctype" : "Clinic/Hospital",
"locname" : "Singapore National Eye Centre"
}
}]
}
ご覧のとおり、モデルには_id
とcontent
が含まれていcontent
ます。 はオブジェクトのリストです。
... ,
{
"id" : "ZZZ",
"loctype" : "ZZZ",
"locname" : "ZZZ"
},
...
PHP
$m = new MongoClient(/* ... */);
$db = $m->myDB;
$collection = $db->coll;
IDのPHPリストを取得するにはどうすればよいですか? 私[1,2]
の場合は。
確かに、すべてのモデルと抽出 ID を取得できますが、mongoDB から直接実行しようとしています。
ありがとう。