{
"_id": ObjectId('58d0789eb9031ac824000001'),
"propertyId": "property001",
"title": "test1",
"imageUrl": "",
"contact": "tom",
"contactphone": "045182321127",
"community": [
{
"_id": "123456789",
"communityId": "community001",
"title": "communitytest",
"imageUrl": "",
"contact": "tom",
"contactphone": "045182321127"
},
{
"communityId": "community002",
"title": "communitytest",
"imageUrl": "",
"contact": "jack",
"contactphone": "045182321127"
},
{
},
{
"communityId": "community003",
"title": "communitytest3",
"imageUrl": "",
"contact": "sfva",
"contactphone": "045182321127"
}
]
}
最初のデータのコレクション“community”
を取得するにはどうすればよいですか?私は"db.test.find({"community.communityId":"community001"})"
リターンを使用しますが、配列の内容を制限したい場合"community"
最初のデータのコレクション "コミュニティ"を取得する方法
*最初のデータ*が何を意味するのかはっきりしません。期待される結果とあなたの現在の質問を追加してください。 –