I have a bunch of JSON files (fixtures) from which I need to delete a field if the "current" object happens to match a select filter.
I'm able to match the desired objects but I'm not sure how to perform the deletion of the field so that the object is modified in-place.
So far this is the closest I've gotten to:
jq '..|objects|select(.__typename == "MyType") | del(.delete_me)' fixture.json
But doesn't seem to work correctly, assignment of the field is straight forward I'm thinking I could probably try and use path as $paths and getpath to set the "parent" value with the output of del but I'm stuck and don't quite fully understand the functions.
Any help is really appreciated!