Figured this line works, but uses jq twice:
cat file.json | jq -c '.[] | select(.property=="undesired")' | jq -c 'del(.property)'
Is there a way to invoke jq just once?
CodePudding user response:
Just pipe the filters together within a single jq
command:
jq -c '.[] | select(. property=="undesired") | del(.property)' file.json