Skip to main content

Filter Query

const filter: Filter = {
type: 'and',
conditions: [
// ...
],
};

Filter query is used to filter records based on specific conditions. It allows you to specify the logical operator (AND/OR) and the conditions or nested filters to apply.

Nested filters can be used to create complex queries by combining multiple conditions or filters together. The type property specifies the logical operator to use when combining the conditions or nested filters.

Complex Filter Example:

const filter: Filter = {
type: 'and',
filters: [
{
type: 'and',
conditions: [
// ...
],
},
{
type: 'or',
conditions: [
// ...
],
},
],
};

Condition

interface Condition {
field: string;
operator: OperatorKey;
value: any;
extendedKey?: string;
}

Condition is used to specify a single condition for filtering records. It includes the field name, operator, and value to compare against.

PropertyTypeDescription
fieldstringThe name of the field to filter on.
operatorOperatorKeyThe operator to use for comparison.
valueanyThe value to compare against.
extendedKeystringThe extended key of referenced record (optional).