Skip to content

Instantly share code, notes, and snippets.

@BenWhitehead
Last active August 29, 2015 13:56
Show Gist options
  • Save BenWhitehead/9335321 to your computer and use it in GitHub Desktop.
Save BenWhitehead/9335321 to your computer and use it in GitHub Desktop.
`jq` map a JSON array to a JSON object indexed by 'id'
## deps: httpie, jq
http GET http://api.example.domain/resource | jq '[.[] | {key: (.id | tostring), value: .}] | from_entries'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment