Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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"}
 
PREVIOUS NEXT
Tagged: #jq #filter #array
ADD COMMENT
Topic
Name
6+8 =