Answers for "jq examples"

1

jq filter array

$ json='[{"genre":"deep house"}, {"genre": "progressive house"}, {"genre": "dubstep"}]'
$ echo "$json" | jq -c '.[] | select(.genre | contains("house"))'
{"genre":"deep house"}
{"genre":"progressive house"}
Posted by: Guest on June-26-2020
0

jq examples

jq '.' fruit.json
Posted by: Guest on September-22-2021
0

jq list top nodes

echo '{"node1":"foo", "node2":"bar","node3": {"inner-node": "baz"}}' | jq '. |=keys'

[
  "node1",
  "node2",
  "node3"
]
Posted by: Guest on November-06-2020
0

jq examples

echo '{"fruit":{"name":"apple","color":"green","price":1.20}}' | jq '.'
Posted by: Guest on September-22-2021

Browse Popular Code Answers by Language