Pluck Property

Extract a specific property value from each object in an array.

Code

General
echo "$arr" | jq --arg k "$key" '[.[] | .[$k]]'

Parameters

JSON array of objects

Property to extract

Server

More Bash Snippets