I have an array of JSON objects:
[{key1: value},{key2:value}, ...]
I would like to reduce them to the following structure:
{key1: value, key2: value, ...}
Can this be done with jq ?
I have tried:
cat myjson.json | jq '.[] | {(.key): value}'
This does not work, because it iterates over each database, rather than reducing it to a single object.
source
share