jq Arrays and Objects/Check whether all items match

Return true if every element satisfies a predicate.

Section: Array Basics

Check whether all items match

bash
bash
echo '[{"active":true},{"active":true}]' | jq 'all(.[]; .active)'
Explanation

`all()` verifies complete compliance across the array.

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
First array item
Get the first element.
OpenIn sheetbashsame section
Last array item
Get the last element.
OpenIn sheetbashsame section
Nth item from array
Get a specific array element by index.
OpenIn sheetbashsame section
Find item index
Find the index of an element in an array.
OpenIn sheetbashsame section
Check array contains value
Test membership in an array.
OpenIn sheetbashsame section
Check whether any item matches
Return true if any element satisfies a predicate.
OpenIn sheetbashsame section