Quantifier Operators
Quantifier operators let you inspect array values and counts without iterating manually.
Use any to check if at least one element in an array satisfies a condition:
any __tags__ of **Article** is equal to "featured"Interactive Example
any over an empty array always returns false.
Use all to check that every element in an array satisfies a condition:
all __scores__ of **Test** is greater than 50Interactive Example
all over an empty array always returns true.
Number Of
Section titled “Number Of”Use the number of to count the elements in an array and compare against a value:
the number of __items__ of **Cart** is greater than 0Interactive Example
You can use number of without the article the:
number of __errors__ of **Report** is equal to 0Length Of
Section titled “Length Of”Use the length of to get the character count of a string (or element count of an array) and compare it:
the length of __username__ of **User** is greater than 3Interactive Example
Works on arrays too — returns the array length:
Interactive Example
Sum Of
Section titled “Sum Of”Use the sum of to add up all numeric values in an array:
the sum of __prices__ of **Order** is greater than 100Interactive Example
Average Of
Section titled “Average Of”Use the average of (or avg of / mean of) to calculate the mean of numeric values:
the average of __scores__ of **Student** is at least 70Interactive Example
Min Of
Section titled “Min Of”Use the min of (or minimum of / smallest of) to find the smallest value in an array:
the min of __bids__ of **Auction** is greater than 10Interactive Example
Max Of
Section titled “Max Of”Use the max of (or maximum of / largest of) to find the largest value in an array:
the max of __temperatures__ of **Report** is less than 100Interactive Example
Compound Predicates
Section titled “Compound Predicates”When array elements are objects, you can check multiple properties of each element using where (or satisfies):
any __items__ of **Order**
where (its __status__ is equal to "shipped"
and its __quantity__ is greater than 0)Each sub-condition starts with its to reference the current element. See Compound Predicates for full details.
Dynamic Key Lookup
Section titled “Dynamic Key Lookup”any and all can iterate over arrays produced by dynamic key lookups:
any __user__ of **request** looked up in **user_roles** looked up in **role_grants**
where (its __action__ is equal to the __action__ of the **request**)This resolves a chain of data lookups before iterating. See Platform RBAC for the current platform access model.
Summary
Section titled “Summary”| Operator | What it checks |
|---|---|
any __prop__ of **Obj** ... | At least one array element matches |
all __prop__ of **Obj** ... | Every array element matches |
any ... where (its __x__ op val and ...) | Element matches compound condition |
any ... looked up in **Target** ... | Iterate over dynamically resolved array |
the number of __prop__ of **Obj** ... | Count of array elements |
the length of __prop__ of **Obj** ... | Character length (string) or element count (array) |
the sum of __prop__ of **Obj** ... | Sum of numeric array elements |
the average of __prop__ of **Obj** ... | Mean of numeric array elements |
the min of __prop__ of **Obj** ... | Smallest numeric array element |
the max of __prop__ of **Obj** ... | Largest numeric array element |