lets say I have collection orders
{
"id":"1",
"items":{
"itemId":"1000",
"name":"Item 1",
"status":"STATUS"
}
}
{
"id":"2",
"items":{
"itemId":"1000",
"name":"Item 1",
"status":"ANOTHER_STATUS"
}
}
I have also collection item_projections which is
{
"id":"1",
"itemId":"1000",
"name":"Item 1",
"orderId":"1"
}
{
"id":"1",
"itemId":"1000",
"name":"Item 1",
"orderId":"2"
}
For every item from collection orders I would like to copy field status to projection to matched on order id and itemId to have
{
"id":"1",
"itemId":"1000",
"name":"Item 1",
"orderId":"1",
"status":"STATUS"
}
{
"id":"1",
"itemId":"1000",
"name":"Item 1",
"orderId":"2",
"status":"ANOTHER_STATUS"
}
Is it possible to do it with aggregation lookup and merge pipelines?