I am trying to query a json through Jsonata but I dont know how to do it.
This is what I have:
{
"first-array": [
{
"param1": {
"status": "SUCCESS"
}
},
{
"param2": {
"status": "FAILURE"
}
},
{
"param3": {
"status": "SUCCESS"
}
}
],
"second-array": [
{
"param1": {
"attribute1": "1",
"attribute2": "2"
}
},
{
"param2": {
"attribute3": "3",
"attribute4": "4"
}
},
{
"param3": {
"attribute5": "5",
"attribute6": "6"
}
}
]
}
This is what I want. filter by SUCCESS status and retrieve only the attributes. For instance:
[
{
"param1": {
"attribute1": "1",
"attribute2": "2"
}
},
{
"param3": {
"attribute5": "5",
"attribute6": "6"
}
}
]
I have tried several things during this week, but I did not reach any way to proceed. Trying with merge functions, overwrite the entire value, instead of append. Trying to filter with something like first-array.*[status = "SUCCESS"] deletes the key where is the content.
Thank you. BR,