Skip to main content
FiQueLa supports rich filtering through 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 the Operator enum before using operators in the fluent API:

Logical operators

Chain multiple conditions using logical operators:
In FQL strings:

Basic examples

LIKE pattern matching

The LIKE operator follows MySQL conventions:
Matching is case-insensitive.

REGEXP pattern matching

The REGEXP 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

The IS 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 with whereGroup(), andGroup(), orGroup(), havingGroup(), and endGroup() to build complex logic. Use havingGroup() specifically to start a grouped condition within the HAVING context:
This produces the SQL-equivalent:
FQL strings also support parentheses for condition grouping: