Operators
This page lists every operator the feat engine supports, grouped by the type of value it compares.
Operators are used in:
- Targeting rules on flags.
- Segments (the same operator set).
Every operator works on the same shape: (attribute path) (operator) (values array). The engine coerces the attribute value to the type the operator expects; if it cannot, the condition does not match and evaluation moves on.
String operators
Section titled “String operators”| Operator | Meaning |
|---|---|
is_one_of | The attribute equals at least one value in the array. |
is_not_one_of | The attribute does not equal any value in the array. |
is_empty | The attribute is missing, null, or an empty string. |
is_not_empty | The attribute is present and non-empty. |
contains | The attribute string contains at least one of the values as a substring. |
does_not_contain | The attribute does not contain any of the values. |
starts_with | The attribute starts with at least one of the values. |
ends_with | The attribute ends with at least one of the values. |
matches_regex | The attribute matches at least one regex in the values array. |
Regex syntax follows the host SDK’s engine (JavaScript regex in the TS SDKs, Go’s regexp package in Go, re in Python, Ruby’s Regexp). For consistency across SDKs, stick to PCRE-style patterns and avoid engine-specific features.
Numeric operators
Section titled “Numeric operators”| Operator | Meaning |
|---|---|
gt | Greater than. |
gte | Greater than or equal. |
lt | Less than. |
lte | Less than or equal. |
The attribute is coerced to a number. Strings that do not parse as numbers do not match.
Date operators
Section titled “Date operators”| Operator | Meaning |
|---|---|
before | The attribute is before the supplied date. |
after | The attribute is after the supplied date. |
The attribute and the supplied value must both be ISO-8601 dates (2026-06-05 or 2026-06-05T10:30:00Z). Unparseable values do not match.
Semver operators
Section titled “Semver operators”For string attributes formatted as semantic versions (4.2.1, 1.0.0-beta.3):
| Operator | Meaning |
|---|---|
semver_eq | Equal. |
semver_gt | Greater than. |
semver_gte | Greater than or equal. |
semver_lt | Less than. |
semver_lte | Less than or equal. |
Useful for “this feature requires app version 4.2 or later.” The semver comparison follows semver.org.
Segment operators
Section titled “Segment operators”| Operator | Meaning |
|---|---|
segment_match | The context is in at least one of the listed segments. |
segment_not_match | The context is in none of the listed segments. |
values is a list of segment keys. The engine evaluates the segment’s rules with the same context. Segment rules can themselves reference other segments; cycles are forbidden by the dashboard. See Segments.
These operators are only available when the segments organization feature is on. See Organization features.
Multi-value semantics
Section titled “Multi-value semantics”When an operator takes a values array of length more than one:
- For positive operators (
is_one_of,contains,starts_with,ends_with,matches_regex,before,after,gtand friends, semver), the condition matches if the attribute matches any value. - For negative operators (
is_not_one_of,does_not_contain,segment_not_match), the condition matches if the attribute matches none of the values.
Inside a condition group, conditions are AND’d; across groups, OR’d. The operator’s multi-value semantics is independent of that.
Missing attributes
Section titled “Missing attributes”If the context does not carry the attribute the condition references, the condition does not match and the rule is skipped. Evaluation moves to the next rule. This is the safe default for anonymous contexts and partially-populated contexts.
Related
Section titled “Related”- Targeting rules for the rule structure.
- Segments for what the segment operators reach into.