Open manishs747 opened 6 years ago
something like
[
{
operation : shift,
spec: {
field_newname : field_oldname,
field_newname1 : field_oldname1,
},
over: "prices[*]"
},
{
operation: shift
spec:{
output : prices
}
}
]
first section will replace original prices keys with new ones, forming an array of objects with only specified keys (with new key names and values from that old keys). second shift will bring every line mentioned to new top-level json
Specks to transform array to array. array length will be dynamic.
eg:
{ "prices": [ { "name": "Journey Mileage", "type": "BASE", "tax": "V20", "amount": 30, "rate": 2.5, "unit": "miles", "charge": 75 } ] }
output: { "charges": [ { "amount": "2095", "currency": "EUR", "type": "price_base" } ] }