WHERE (pre-aggregation) and HAVING (post-aggregation) conditions. Both use the same operator set and can be combined with logical operators and groups.
FiQueLa 3.0 — the field argument of
where() and having() accepts any SQL expression, not just a plain field name. Function calls, infix arithmetic, and nested expressions are all evaluated by the runtime expression evaluator before the operator is applied.WHERE vs HAVING
Comparison operators
Import theOperator enum before using operators in the fluent API:
Logical operators
Chain multiple conditions using logical operators:Basic examples
LIKE pattern matching
TheLIKE operator follows MySQL conventions:
REGEXP pattern matching
TheREGEXP operator accepts a regular expression pattern. If the pattern includes delimiters (e.g. /pattern/i), they are used as-is. Otherwise the pattern is wrapped in / delimiters automatically.
IS operator — type checking
TheIS and IS NOT operators check the PHP type of a field value. Pass a Type enum constant as the right-hand operand:
In FQL strings, use the type name directly:
Condition grouping
Group conditions withwhereGroup(), andGroup(), orGroup(), havingGroup(), and endGroup() to build complex logic. Use havingGroup() specifically to start a grouped condition within the HAVING context: