Is there a way to add extra property in array item with top level object value? My input is like
{
"ABC": {
"news": [{
"datetime": "2019-03-06T14:12:00-05:00",
"source": "source 1",
"summary": "asd ada dsd f ef sdf vert"
}
]
},
"XYZ": {
"news": [{
"datetime": "2019-03-06T14:12:00-05:00",
"source": "source 1",
"summary": "asd ada dsd f ef sdf vert"
}
]
}
}
and expected output is
"news": [{
"symbol": "ABC",
"datetime": "2019-03-06T14:12:00-05:00",
"source": "source 1",
"summary": "asd ada dsd f ef sdf vert"
},
{
"symbol": "XYZ",
"datetime": "2019-03-06T14:12:00-05:00",
"source": "source 1",
"summary": "asd ada dsd f ef sdf vert"
}
]
by using below spec I could merge two arrays, but I struggling to add symbol in the item.
[{
"operation": "shift",
"spec": {
"*": {
"news": {
"*": ""
}
}
}
}]