Given a json file, in the format:
{ "content": [ {"name":some_name}, {"name": null} ] }
The following command would extract only the entries where the name is not null:
cat file.json | jq '.content | .[] | select(.name != null) | {name: .name}'
Developer from somewhere
Given a json file, in the format:
{ "content": [ {"name":some_name}, {"name": null} ] }
The following command would extract only the entries where the name is not null:
cat file.json | jq '.content | .[] | select(.name != null) | {name: .name}'