bazaarvoice / jolt

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

Spec to remove data dynamically based on another key #1200

Closed Dhanrajkannan closed 1 year ago

Dhanrajkannan commented 1 year ago

Hi, I tried multiple ways. but not able to get the right spec for the expected output. Requirement is to use the elements in _items_todelete to determine the keys to be deleted. Any help is much appreciated.

Input 1 { "data": { "items_to_delete": [ "a*" ], "a1": "1", "a2": null, "b": "3", "c": "4" } }

Output 1 { "data": { "items_to_delete": [ "a*" ], "b": "3", "c": "4" } }

Input 2 { "data": { "items_to_delete": [ “b*” ], "a1": "1", "a2": null, "b": "3", "c": "4" } }

Output 2 { "data": { "items_to_delete": [ “b*” ], "a1": "1", "a2": null, "c": "4" } }