Conditional: :if
Evaluates a condition and returns one of two branches.
:then branch:
Switch: :case
Matches a value against a list of options. Returns the result for the first match, or the :else fallback if nothing matches.
:if chains when you have multiple known values to match against.
Comparison: :cmp
Compares a value against one or more thresholds. Returns true or false.
Supported modifiers:
| Modifier | Meaning |
|---|---|
:eq | Equal to |
:neq | Not equal to |
:gt | Greater than |
:gte / :ge | Greater than or equal to |
:lt | Less than |
:lte / :le | Less than or equal to |
:if:
| age.
Equality: :eq
Tests whether all values in a list are equal to each other.
Uniqueness: :distinct
Returns true if all values in the list are different from each other.
Membership: :in / :nin
Tests whether a value exists (or doesn’t exist) in a given list.
:in — value is in the list:
:nin — value is NOT in the list:
:if for access control and routing:
Boolean Helpers
:not
Negates a boolean value.
:every
Returns true if every item in an array satisfies a condition. The condition is evaluated for each item with @item as the current element.
:some
Returns true if at least one item satisfies a condition.
Logical Constants
Explicit boolean and null values for use in expressions where you need to return a fixed value.:if branches or :map transformations when you need to produce a specific constant value programmatically.