[
{
"data": {
"id": "123",
"name": "delta1"
},
"property_data": [
{
"ser_name": "Insights",
"ser_value": "10000"
},
{
"ser_name": "plans",
"ser_value": "50000"
}
]
}
]
Explanation : property_data is an array. data is an object. Need to transform Array into an object, but the problem is if I do $unwind on property_data I get multiple times data objects, which I needed only once. I want to convert my data structure, into multiple documents but data should not be repeated again and again
Expected Output
[
{
"property_data": {
"id": "123",
"name": "delta1"
}
},
{
"property_data": {
"ser_name": "Insights",
"ser_value": "10000"
}
},
{
"property_data": {
"ser_name": "plans",
"ser_value": "50000"
}
},
]