How can I break and flatten nested JSON with arrays using Jolt transformations
from:
{
"product": [
"data - 1",
"data - 2"
],
"Purchase": [
2,
2
],
"Renewal": 1
}
to
[
{
"product": "data -1",
"Purchase": 1,
"Renewal": 1
},
{
"product": "data -2",
"Purchase": 2,
}
]
My current jolt transformation doesn't give me fully accurate transformation
[
{
"operation": "shift",
"spec": {
"*": {
"*": {
"@": "[#2].&2"
}
}
}
}
]