jq
Create Assigning/updating a value that does not exists will create it. See Update Below for example
lists
If you want the output to be a list
jq '.items' input.json
If you want the output to be just the objects
jq '.items[]' input.json
values
jq '.items[0].key' input.json
jq '.nested.key' input.json
item from a list with key that has specific value
jq '.items[] | select(.name | contains("value"))' input.json
Updating a value
jq '.nested.key = "new_value"' input.json
Adding to a list
jq '.items += [{"name":"new_value"}]' input.json
a key
jq 'del(.nested.key)' input.json
References:
man jq
Tags:
#literature-note #unix #tools