Skip to content

jq#

Playground

Merge list of dictionaries#

{
  "root":
  [
    {
      "name": "k1",
      "property": "v1"
    },
    {
      "name": "k2",
      "property": "v2"
    }
  ]
}

.root | map({(.name): (.property)}) | add
{
  "k1": "v1",
  "k2": "v2"
}