Base filters
Default filter
The default filter model is a base model that can be used to create more specific filter models.
/** A base filter model that can be used to create more specific filter models */model DefaultFilter { /** The operator to apply to the filter value */ operator: | ComparisonOperators | ArrayOperators | StringOperators | RangeOperators | AllOperators;
/** The value to use for the filter operation */ value: unknown;}
$schema: https://json-schema.org/draft/2020-12/schema$id: DefaultFilter.yamltype: objectproperties: operator: anyOf: - $ref: ComparisonOperators.yaml - $ref: ArrayOperators.yaml - $ref: StringOperators.yaml - $ref: RangeOperators.yaml - $ref: AllOperators.yaml description: The operator to apply to the filter value value: description: The value to use for the filter operationrequired: - operator - valuedescription: A base filter model that can be used to create more specific filter models
EquivalenceOperators
Operators that filter a field based on an exact match to a value. Supported value types include:
- string
- number
- boolean
- date
- money
Operator | Description | Property | True value | False value |
---|---|---|---|---|
eq | Equal to a value | "foo" | "foo" | "bar" |
neq | Not equal to a value | "foo" | "bar" | "foo" |
/** Operators that filter a field based on an exact match to a value */enum EquivalenceOperators { /** Equal to a value */ eq,
/** Not equal to a value */ neq,}
$schema: https://json-schema.org/draft/2020-12/schema$id: EquivalenceOperators.yamltype: stringenum: - eq - neqdescription: Operators that filter a field based on an exact match to a value
ComparisonOperators
Operators that filter a field based on a comparison to a value. Supported value types include:
- number
- date
- money
Operator | Description | Property | True value | False value |
---|---|---|---|---|
gt | Greater than a value | 10 | 15 | 5 |
gte | Greater than or equal to a value | 10 | 10 | 9 |
lt | Less than a value | 10 | 5 | 15 |
lte | Less than or equal to a value | 10 | 10 | 11 |
/** Operators that filter a field based on a comparison to a value */enum ComparisonOperators { /** Greater than a value */ gt,
/** Greater than or equal to a value */ gte,
/** Less than a value */ lt,
/** Less than or equal to a value */ lte,}
$schema: https://json-schema.org/draft/2020-12/schema$id: ComparisonOperators.yamltype: stringenum: - gt - gte - lt - ltedescription: Operators that filter a field based on a comparison to a value
StringOperators
Operators that filter a field based on a string value.
Operator | Description | Property | True value | False value |
---|---|---|---|---|
like | Like | "hello" | "hell" | "world" |
not_like | Not like | "hello" | "world" | "hell" |
/** Operators that filter a field based on a string value */enum StringOperators { /** Like */ like,
/** Not like */ not_like,}
$schema: https://json-schema.org/draft/2020-12/schema$id: StringOperators.yamltype: stringenum: - like - not_likedescription: Operators that filter a field based on a string value
ArrayOperators
Operators that filter a field based on an array of values. Supported value types include:
- string
- number
Operator | Description | Property | True value | False value |
---|---|---|---|---|
in | In an array of values | "A" | ["A", "B"] | ["B", "C"] |
not_in | Not in an array of values | "A" | ["B", "C"] | ["A", "B"] |
/** Operators that filter a field based on an array of values */enum ArrayOperators { /** In an array of values */ in,
/** Not in an array of values */ not_in,}
$schema: https://json-schema.org/draft/2020-12/schema$id: ArrayOperators.yamltype: stringenum: - in - not_indescription: Operators that filter a field based on an array of values
RangeOperators
Operators that filter a field based on a range of values. Supported value types include:
- number
- date
- money
Operator | Description | Property | True value | False value |
---|---|---|---|---|
between | The value must be between the two values | 5 | {"min": 1, "max": 10} | {"min": 10, "max": 20} |
outside | The value must be outside the two values | 5 | {"min": 10, "max": 20} | {"min": 1, "max": 10} |
/** Operators that filter a field based on a range of values */enum RangeOperators { /** Between a range of values */ between,
/** Outside a range of values */ outside,}
$schema: https://json-schema.org/draft/2020-12/schema$id: RangeOperators.yamltype: stringenum: - between - outsidedescription: Operators that filter a field based on a range of values