Cheatsheet Pages / jq Cheatsheet
How to sort JSON objects by a field with jq — sort_by
The array is in arrival order and you need it ordered by age.
Every filter was executed against the cheatsheet's sample config.json with jq 1.7 before publishing; the sample file sits at the bottom of the cheatsheet so you can reproduce every output.
jq '.users | sort_by(.age) | map(.name)' config.json
# output: ["bruno","ana","carla"] (17, 28, 34)
