JQ map example
Transform each element of a JSON array with jq map(). Interactive example that reshapes and renames fields for every object in an array.
The jq expression
map(f) applies the filter f to every element of an array and collects the results into a new array. It is the standard way to reshape a list of objects. Here we map over .countries and build a new object per country, keeping name and id while renaming population to people.