I am trying to transform a JSON using Jolt transformation looking for some input here. I am trying to filter by the value of the attribute.
My goal is to get an array that contains only the items with the action 'remove'.
Here is my input and expected output:
Input:
{
"id": 11,
"item": [
{
"id": "11_1",
"action": "add",
"item": [
{
"id": "11_1_1",
"action": "add",
"item": [
{
"id": "11_1_1_1",
"action": "remove"
}
]
},
{
"id": "11_1_2",
"action": "remove",
"item": [
{
"id": "11_1_2_1",
"action": "remove"
}
]
}
]
}
]
}
Expected output:
[
{
"id": "11_1_1_1",
"action": "remove"
},
{
"id": "11_1_2",
"action": "remove"
},
{
"id": "11_1_2_1",
"action": "remove"
}
]
Can you please help me to write a simple spec that will do this?
