Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 582

How to merge json object with same keys?

$
0
0

Here are the 2 items in one array:

{"SysID": "12345","Name": "abc"}{"SysID": "12345","Name": "def"}{"SysID": "23456","Name": "hij"}{"SysID": "23456","Name": "klm"}{"SysID": "23456","Name": "nop"}

I would like to transform "SysID" into key and "Name" as the value of it in array:

{"12345": ["abc","def",  ],"23456": ["hij","klm","nop",  ],}

May I know how could I do that in jq?


Viewing all articles
Browse latest Browse all 582


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