Test membership in an array.
Section: Array Basics
Check array contains value
bash
bash
echo '["a","b","c"]' | jq 'contains(["b"])'Explanation
`contains()` works for arrays and objects.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Array Basics
Check whether any item matches
Return true if any element satisfies a predicate.
Check whether all items match
Return true if every element satisfies a predicate.