Object containing filtering rules which will evaluate against context object. Filter can be an instance of 5 different filter types described below.
Filter Schema
Attribute
Type
Desription
type
group
Filter group will evaluate by applying a logical operation to the array of filters provided
filters
Filter[]
Array of filters
operator
enum(and, or)
Logical operation
Attribute
Type
Desription
type
negation
Negation filter is used to negate the evaluation result of the underlying filters.
filter
Filter
Filter object to be negated
Attribute
Type
Desription
type
context
field
string
Refers to a field of the context object.
Example: company.tier
values
string[]
Array of values which will be compared with the value of the context field. Operators SET, NOT_SET, IS_TRUE, IS_FALSE require 0 values, ANY_OF and NOT_ANY_OF support multiple values. All the other operators require exactly one value.
Operator for comparison of the context field with provided values.
Attribute
Type
Desription
type
rolloutPercentage
Rollout percentage filter is used for gradual rollouts. It evaluates to true or false proportionally based on the rollout threshold provided. Bucket evaluates the filter by calculating a numeric hash from the rollout attribute. Contexts of which hash is under the threshold provided will evaluate to true.
partialRolloutAttribute
company.id
Currently only "company.id" is supported.
partialRolloutThreshold
number
Number from 0 to 10000 where 0 means no one will have access and 10000 means everyone will have access.
Attribute
Type
Desription
type
constant
Filter constant will evaluate to the value provided. This is expected when the feature is enabled either for everyone or no one.