Skip to content

Operators

Flagship supports 11 comparison operators for targeting rule conditions. Each operator compares an attribute from the evaluation context against a specified value.

Operator reference

OperatorDescriptionExampleValue type
equalsReturns true if the attribute value matches the specified value.country equals "US"String
not_equalsReturns true if the attribute value does not match the specified value.plan not_equals "free"String
greater_thanReturns true if the attribute value is greater than the specified value.age greater_than 18Number, ISO 8601 datetime
less_thanReturns true if the attribute value is less than the specified value.loginCount less_than 5Number, ISO 8601 datetime
greater_than_or_equalsReturns true if the attribute value is greater than or equal to the specified value.score greater_than_or_equals 90Number, ISO 8601 datetime
less_than_or_equalsReturns true if the attribute value is less than or equal to the specified value.createdAt less_than_or_equals "2025-01-01T00:00:00Z"Number, ISO 8601 datetime
containsReturns true if the attribute value contains the specified substring.email contains "@cloudflare.com"String
starts_withReturns true if the attribute value starts with the specified prefix.path starts_with "/api/v2"String
ends_withReturns true if the attribute value ends with the specified suffix.domain ends_with ".dev"String
inReturns true if the attribute value is in the specified array.country in ["US", "CA", "UK"]Array
not_inReturns true if the attribute value is not in the specified array.userId not_in ["blocked-1", "blocked-2"]Array

Operator categories

Equality operators

equals, not_equals

Use these operators for exact string matching. The comparison is case-sensitive.

Comparison operators

greater_than, less_than, greater_than_or_equals, less_than_or_equals

These operators work with numeric values and ISO 8601 datetime strings. When comparing datetimes, provide the value in ISO 8601 format (for example, "2025-01-01T00:00:00Z").

String operators

contains, starts_with, ends_with

These operators perform substring matching against the attribute value. All string comparisons are case-sensitive.

Array operators

in, not_in

The value must be an array. Flagship checks whether the attribute value is a member of the specified array.