[{
"username":"user1",
"products":[
{"productID":1,"itemCode":"CODE1"},
{"productID":2,"itemCode":"CODE1"},
{"productID":3,"itemCode":"CODE2"},
]
},
{
"username":"user2",
"products":[
{"productID":1,"itemCode":"CODE1"},
{"productID":2,"itemCode":"CODE2"},
]
}]
제품의 "itemCode"가 "CODE1"이되도록 "user1"에 대한 "products"의 모든 "productID"를 찾고 싶습니다.mongoDB 쿼리 중첩 배열의 문서를 찾으려면
mongoDB에서 어떤 쿼리를 작성해야합니까?
내 업데이트 된 대답을 확인 –
@ ReubenL. thnx, – Krisalay