Comparison Operators
FlyQL supports the following comparison operators:
Equality
Section titled “Equality”| Operator | Name | Example |
|---|---|---|
= | Equals | status = 200 |
!= | Not equals | env != 'prod' |
status = 200
service != "api-gateway"
Both sides of the operator are required — a key and a value.
Numeric Comparison
Section titled “Numeric Comparison”| Operator | Name | Example |
|---|---|---|
> | Greater than | status > 399 |
>= | Greater or equals | status >= 400 |
< | Less than | duration < 1000 |
<= | Less or equals | duration <= 500 |
status >= 400 and duration < 5000
response_time > 100 and response_time <= 2000
Numeric comparison operators are designed for numeric values.
String Comparison
Section titled “String Comparison”The same operators (>, >=, <, <=) also work on string values, where they perform lexicographic (alphabetical) comparison:
name > 'm'
path <= '/api/z'
Regex Matching
Section titled “Regex Matching”| Operator | Name | Example |
|---|---|---|
~ | Regex match | message ~ "error.*" |
!~ | Not regex match | path !~ "^/health" |
message ~ "timeout|connection refused"
host !~ "^test-.*"
Regex patterns follow the syntax of the target database or runtime. See Pattern Matching for regex flags and details.
List Membership
Section titled “List Membership”| Operator | Name | Example |
|---|---|---|
in | In list | status in [200, 201] |
not in | Not in list | env not in ['dev', 'test'] |
See the Lists page for detailed list syntax rules.
Pattern Matching (LIKE)
Section titled “Pattern Matching (LIKE)”| Operator | Name | Example |
|---|---|---|
like | Like pattern | message like 'error%' |
not like | Not like pattern | host not like 'test%' |
ilike | Case-insensitive like | message ilike 'Error%' |
not ilike | Case-insensitive not like | host not ilike 'TEST%' |
message like '%timeout%'
host not like '%-staging'
path ilike '/API/%'
SQL-style pattern matching with two wildcards:
%— matches any sequence of characters (including empty)_— matches exactly one character
Escape wildcards with a backslash to match them literally: \% matches a literal %, \_ matches a literal _.
See Pattern Matching for more details and examples.
Containment Check
Section titled “Containment Check”| Operator | Name | Example |
|---|---|---|
has | Contains | message has 'error' |
not has | Does not contain | message not has 'test' |
message has 'timeout'
tags not has 'deprecated'
The has operator performs a type-dependent containment check:
- String — substring match:
message has 'error'is true ifmessagecontains“error” - Map — key existence:
metadata has 'region'is true if the map has a key“region” - Array/List — item membership:
tags has 'web'is true if the array contains“web” - JSON — key existence:
data has 'name'is true if the JSON object has a key“name” - Null/empty — always false for both
hasandnot has
has takes a single value (not a list). Use in for checking membership in a set of values.
Operator Summary
Section titled “Operator Summary”| Operator | Name | Example |
|---|---|---|
= | Equals | status = 200 |
!= | Not equals | env != 'prod' |
> | Greater than | count > 10 |
>= | Greater or equals | count >= 10 |
< | Less than | count < 100 |
<= | Less or equals | count <= 100 |
~ | Regex match | msg ~ "err.*" |
!~ | Not regex match | msg !~ "^ok" |
in | In list | s in [1, 2] |
not in | Not in list | s not in [3] |
has | Contains | msg has 'err' |
not has | Not contains | msg not has 'ok' |
like | Like pattern | msg like 'err%' |
not like | Not like | msg not like 'ok%' |
ilike | Like (case-insensitive) | msg ilike 'Err%' |
not ilike | Not like (case-insensitive) | msg not ilike 'Ok%' |