Skip to content

Comparison Operators

FlyQL supports the following comparison operators:

OperatorNameExample
=Equalsstatus = 200
!=Not equalsenv != 'prod'
status = 200
service != "api-gateway"

Both sides of the operator are required — a key and a value.

OperatorNameExample
>Greater thanstatus > 399
>=Greater or equalsstatus >= 400
<Less thanduration < 1000
<=Less or equalsduration <= 500
status >= 400 and duration < 5000
response_time > 100 and response_time <= 2000

Numeric comparison operators are designed for numeric values.

The same operators (>, >=, <, <=) also work on string values, where they perform lexicographic (alphabetical) comparison:

name > 'm'
path <= '/api/z'
OperatorNameExample
~Regex matchmessage ~ "error.*"
!~Not regex matchpath !~ "^/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.

OperatorNameExample
inIn liststatus in [200, 201]
not inNot in listenv not in ['dev', 'test']

See the Lists page for detailed list syntax rules.

OperatorNameExample
likeLike patternmessage like 'error%'
not likeNot like patternhost not like 'test%'
ilikeCase-insensitive likemessage ilike 'Error%'
not ilikeCase-insensitive not likehost 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.

OperatorNameExample
hasContainsmessage has 'error'
not hasDoes not containmessage 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 if message contains “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 has and not has

has takes a single value (not a list). Use in for checking membership in a set of values.

OperatorNameExample
=Equalsstatus = 200
!=Not equalsenv != 'prod'
>Greater thancount > 10
>=Greater or equalscount >= 10
<Less thancount < 100
<=Less or equalscount <= 100
~Regex matchmsg ~ "err.*"
!~Not regex matchmsg !~ "^ok"
inIn lists in [1, 2]
not inNot in lists not in [3]
hasContainsmsg has 'err'
not hasNot containsmsg not has 'ok'
likeLike patternmsg like 'err%'
not likeNot likemsg not like 'ok%'
ilikeLike (case-insensitive)msg ilike 'Err%'
not ilikeNot like (case-insensitive)msg not ilike 'Ok%'