bazaarvoice / jolt

JSON to JSON transformation library written in Java.
Apache License 2.0
1.56k stars 329 forks source link

Removing arrays from JSON if at least one element is null. #1109

Open rustoherox opened 3 years ago

rustoherox commented 3 years ago

Hello, guys!

I'm new to JOLT. It is amazing feature but difficult to use in some moments :)

I do some shift and default operations for my input data, so I in one step to finish but I can't reach it. I have two arrays of arrays and last task is to remove all nested arrays where is null.

My Input JSON: { "uids" : [ [ 1, 2, null ], [ 1, 2, "3" ], [ 3, 4, "5" ]], "eventAttrs" : [ [ 12301, "A" ], [ 12309, null]] }

Desired Output: { "uids" : [[ 1, 2, "3" ], [ 3, 4, "5" ]], "eventAttrs" : [[ 12301, "A" ]] }

After all searching out, I only have achieved deleting value from array on equal condition, no more...