Given the following input:
[
{
"users": [
{
"external_id": "aaa",
"first_name": "john",
"last_name": "doe",
"email": "[email protected]"
},
{
"external_id": "bbb"
},
{
"external_id": "ccc"
}
],
"message": "success"
}
]
I need the following output:
[
{
"external_id": "bbb"
},
{
"external_id": "ccc"
}
]
I want to filter external_id that doesn’t have first_name,last_name and email associated with it
I just tried shift operation and it gets all the external_id.
2
Answers
You can use this spec:
One option is to use
~
operator to check the existence of one of the attributes fromfirst_name
,last_name
oremail
, in this case I’ve chosenfirst_name
for the modify transformation spec. Then dive up to the innermost object to derive the matching values while making others null to be prepared to be extinguished within the next transformation spec such as