i want data of orders collection where order _id =1 and her inventId object with it... i want the same output, i attach all of the code given blow please check and make a query for me... which response is same as i want Orders Collection
[
{
"_id": 1,
"item": "almonds",
"price": 12,
"inventId": [
{
"id": 1
},
{
"id": 2
},
],
"quantity": 2
},
{
"_id": 2,
"item": "pecans",
"price": 32,
"inventId": [
{
"id": 1
},
],
}
],
inventoryCollection
"inventory": [
{
"_id": 1,
"sku": "almonds",
"description": "product 1",
"instock": 120
},
{
"_id": 2,
"sku": "bread",
"description": "product 2",
"instock": 80
},
{
"_id": 3,
"sku": "cashews",
"description": "product 3",
"instock": 60
},
]
and the output which i want..
[
{
"_id": 1,
"item": "almonds",
"price": 12,
"quantity": 2,
"inventory_docs":[
{
"_id": 1,
"description": "product 1",
"instock": 120,
"sku": "almonds"
}, {
"_id": 2,
"description": "product 2",
"instock": 80,
"sku": "bread"
}
]
}
]