Quantcast
Viewing all articles
Browse latest Browse all 521

Use jq to merge list of dictionaries into one dictionary with keys

I have a dictionary like:

{"Items": [        {"ID": "123abc","Name": "test name","Description": "item 1"        },        {"ID": "321zyx","Name": "test name two","Description": "item 2"        }    ]}

I'd like to use jq to convert this into:

{"123abc": {"Name": "test name","Description": "item 1"    },"321zyx": {"Name": "test name two","Description": "item 2"    }}

Is that possible? If so, how would I accomplish this?


Viewing all articles
Browse latest Browse all 521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>