Issue
Below is my JSON and i need JOLT to remove if destSiteName is unknown. Need to keep the rest of the object.
{
"destSiteName": "unknown",
"customer_code": "code1"
}
Solution
You might use a shift transformation which contains two conditionals
- whether outermost attribute is
"destSiteName"
or not ("*"
)
or
- whether value of
"destSiteName"
is"unknown"
or not ("*"
)
[
{
"operation": "shift",
"spec": {
"destSiteName": {
"unknown": "",
"*": { "@1": "&2" }
},
"*": "&"
}
}
]
Answered By - Barbaros Özhan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.