Skip to content

List Operators

List operators check whether a value exists in a set or whether a collection contains a value.

Is In

Check if a value is one of a set of allowed values:

__role__ of **User** is in ["admin", "moderator", "editor"]

Interactive Example

Policy Rule
Test Data (JSON)

Works with numbers too:

Interactive Example

Policy Rule
Test Data (JSON)

Is Not In

Check if a value is not in a set (blocklist):

__status__ of **User** is not in ["banned", "suspended", "deleted"]

Interactive Example

Policy Rule
Test Data (JSON)

Contains

Check if a string or collection contains a value:

__tags__ of **Article** contains "featured"

Interactive Example

Policy Rule
Test Data (JSON)

Summary

OperatorUse case
is in [...]Value is one of a set (allowlist)
is not in [...]Value is none of a set (blocklist)
containsString/collection contains a value