I wanted to rename field inside a nested array which looks like below:
So I want to rename StockCode
field name to ArticleNo
in every Items
element.
{
"_id": "44f9d742-4070-4980-a32b-90e79bedd96a",
"Configuration": {
"Orders": [
{
"Items": [
{
"StockCode": "123456",
"OrderedQuantity": 1,
},
{
"StockCode": "789658",
"OrderedQuantity": 4
}
]
}
]
}
}
What is the aggregation I could use in this situation, the complete aggregation is also very welcome.
Thank you for your attention.