From the docs:
jq '.[] | select(.id == "second")'
Input
[{"id": "first", "val": 1}, {"id": "second", "val": 2}]
Output
{"id": "second", "val": 2}
I think you can do something like this:
jq '.theList[] | select(.id == 2 or .id == 4)' array.json
From the docs:
jq '.[] | select(.id == "second")'
Input
[{"id": "first", "val": 1}, {"id": "second", "val": 2}]
Output
{"id": "second", "val": 2}
I think you can do something like this:
jq '.theList[] | select(.id == 2 or .id == 4)' array.json