Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 527 Bytes

pluck-value-from-an-array.md

File metadata and controls

16 lines (13 loc) · 527 Bytes

Pluck every value from an array

JQ is a super powerful command line JSON processor. One of the many things it can do is iterate over an array and pull out the value for a specified key.

Real world example:

curl http://api.citybik.es/citi-bike-nyc.json | jq '[.[] | .name]'

The above is the same as using map as specified in the docs

curl http://api.citybik.es/citi-bike-nyc.json | jq 'map(.name)'