FilterQueryBuilder
Infix DSL for building filter queries.
Each operation appends a filter_query[<field>][<operation>]=<value> parameter, naming the field by a property reference of T resolved to its serialized name. Collection values are joined with commas, as the API expects.
The operations do not constrain the property's Kotlin type: Storyblok serializes numbers as JSON strings, so a numeric field is as likely to be modelled as a String as a Double, and requiring one would rule out valid schemas. The comparison operations are the exception — they check the field can hold the operand they are given.
A property reference addresses one of T's own fields, so nested blocks and fields — which the API addresses with a dotted path, seo.description or body.0.name — have no entry point here, and a reference to the containing field alone filters on the whole object rather than on a property inside it. Write those out with Query.parameter:
parameter("filter_query[seo.description][is]", "not_empty")Type Parameters
The Component type the enclosing query is built for.
Functions
all_in_array: the array field contains all of the given values.
any_in_array: the array field contains any of the given values.
gt_float: the float field value is greater than the given value. Applies to values written with a decimal point, whether the field is a number field or a text field.
gt_int: the integer field value is greater than the given value. Applies to values written without a decimal point, whether the field is a number field or a text field.
gt_date: the date field value is after the given instant.
is: the field value is of the given value type.
in: the field value matches any of the given values.
lt_float: the float field value is less than the given value. Applies to values written with a decimal point, whether the field is a number field or a text field.
lt_int: the integer field value is less than the given value. Applies to values written without a decimal point, whether the field is a number field or a text field.
lt_date: the date field value is before the given instant.
not_in: the field value matches none of the given values.