[jq] Check whether at least one array element matches a condition

Created on November 30, 2026

Use any to test whether an array contains at least one matching value. This example looks for a number of 10 or greater.

echo '[3, 7, 12]' | jq 'any(.[]; . >= 10)'
true

The generator .[] supplies each element to the condition. any returns false if none match.

jq