I have generated below Json using Jackson lib in Java:
{
"name": "name1",
"version": "0.0.1",
"storage": {
"db": {
"test_field1": "STRING",
"t_dlm1": "STRING",
"test_field2": "STRING",
"t_dlm2": "STRING"
},
"test": {
"test11": "STRING",
"test2": {
"test3": "0",
"r_dlm4": "0"
},
"test5": {
"test6": "0",
"h_dlm7": "0"
}
},
"test8": {
"test9": "STRING",
"f_dlm10": "STRING"
}
}
}
Now I am a requirement of remove those json node or field (key and value) that contains "dlm" word.
I tried remove and removeAll method , with that i am able to remove specific field but need to pass full exact name of field.
I am bit new here please guide me here how to remove json node if field name contains "dlm" word
expected json:
{
"name": "name1",
"version": "0.0.1",
"storage": {
"db": {
"test_field1": "STRING",
"test_field2": "STRING"
},
"test": {
"test11": "STRING",
"test2": {
"test3": "0"
},
"test5": {
"test6": "0"
}
},
"test8": {
"test9": "STRING"
}
}
}