Skip to content

Filters

Filters narrow query results. They can be applied to Get and Scan requests and combined to form complex logic. Use And and Or to combine conditions or Not to invert them.

The filters below target a specific property via a property reference.

Checks whether a value exists.

Exists(
propertyReference1,
propertyReference2,
propertyReference3,
)

Matches when a property equals the provided value.

Equals(
stringPropertyReference with "value",
numberPropertyReference with 5,
)

Matches when the value is greater than the provided value.

GreaterThan(
stringPropertyReference with "value",
intPropertyReference with 42,
)

Matches when the value is greater than or equal to the provided value.

GreaterThanEquals(
stringPropertyReference with "value",
intPropertyReference with 42,
)

Matches when the value is less than the provided value.

LessThan(
stringPropertyReference with "value",
intPropertyReference with 42,
)

Matches when the value is less than or equal to the provided value.

LessThanEquals(
stringPropertyReference with "value",
intPropertyReference with 42,
)

Checks whether the value falls within a range.

Maryk YAML:

Range(
intPropertyReference with 2..42,
stringPropertyReference with ValueRange(
from = "abba",
to = "zeplin",
inclusiveTo = false,
)
)

Matches values that start with the given prefix.

Prefix(
stringPropertyReference with "val",
anotherStringPropertyReference with "do",
)

Matches values that satisfy a regular expression.

RegEx(
stringPropertyReference with "[A-Z]+al.*",
anotherStringPropertyReference with "[E-Z]+al.*",
)

Matches when the value is included in a provided set.

ValueIn(
stringPropertyReference with setOf("a", "b", "value"),
intPropertyReference with setOf(1, 3, 5),
)

Filter operations combine other filters to build complex queries.

And returns true only if all included filters match.

And(
Equals(
stringPropertyReference with "value"
),
GreaterThan(
intPropertyReference with 42
)
)

Or returns true if any of the included filters matches.

Or(
Equals(
stringPropertyReference with "value"
),
GreaterThan(
intPropertyReference with 42
)
)

Not inverts the result of the nested filters. If multiple filters are provided it behaves as And and negates the combined result.

Not(
Equals(stringPropertyReference equals "value"),
Exists(intPropertyReference),
)