Convert array to lines jq
Raw output (-r) for scripting; one value per line
cat data.json | jq -r '.items[].metadata.name'
more jq
all 17 commands →
Merge two JSON objects
jq -s '.[0] * .[1]' base.json override.json
Select non-null fields
jq '[.[] | select(.value != null)]' data.json
Group by field
jq 'group_by(.status) | map({status: .[0].status, count: length})' data.json
Flatten nested array
jq 'flatten(1)' nested.json
Convert array to object (index_by)
jq 'INDEX(.[]; .id)' items.json