jq in array code example
Example 1: jquery in array
function isInArray(value, array) {
return array.indexOf(value) > -1;
}
Example 2: 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"}