0
중첩 된 배열 문서를 찾는 방법이 필요합니다.mongo에서 하위 문서 내에 데이터를 가져 오는 방법을 찾아야합니다.
street_1
안에 값이 일치하는 것을 찾고 싶습니다.
db.phonebook.find({'address.home.street_1' : 'street 1 result'});
내 문서 :
{
"_id" : ObjectId("53788c0c74d3ead0098b4568"),
"first_name" : "jarod",
"last_name" : "petters",
"company" : "nostromos",
"phone_numbers" : [
{
"cell" : "0752203337"
},
{
"home" : "0850819201"
},
{
"home" : "0499955550"
}
],
"website" : "http://www.mywebsite.com",
"email" : [
{
"home" : "email.first.com"
},
{
"office" : "email.second.com"
}
],
"address" : [
{
"home" : {
"stree_1" : "street 1 result",
"stree_2" : "",
"postal_code" : "66502",
"city" : "my littre city",
"country" : "usa"
}
}
],
"nationality" : "mars",
"date_of_birth" : "1978-01-01"
}
감사합니다;) – user1032324
답변이 도움이 될 경우 대답을 수락하십시오. – kranteg