Numeric filters
NumberComparisonFilter
Section titled “NumberComparisonFilter”Filters by comparing a field to a numeric value.
Property | Type | Description |
---|---|---|
operator | ComparisonOperators | The operator to apply to the filter value |
value | numeric | The value to use for the filter operation |
Formats
Section titled “Formats”A JSON example of this field is:
{ "operator": "eq", "value": 1000}
The JSON schema for this field is:
$schema: https://json-schema.org/draft/2020-12/schema$id: NumberComparisonFilter.yamltype: objectproperties: operator: $ref: ComparisonOperators.yaml description: The comparison operator to apply to the filter value value: type: number description: The value to use for the filter operationrequired: - operator - valuedescription: Filters by comparing a field to a numeric value
The TypeSpec code for this field is:
/** Filters by comparing a field to a numeric value */model NumberComparisonFilter { /** The comparison operator to apply to the filter value */ operator: ComparisonOperators;
/** The value to use for the filter operation */ @example(1000) value: numeric;}
The Python code for this filter is:
from dataclasses import dataclass
@dataclassclass NumberComparisonFilter: operator: ComparisonOperators value: float
# Example usage:number_comparison_filter = NumberComparisonFilter( operator=ComparisonOperators.EQ, value=1000)
NumberRangeFilter
Section titled “NumberRangeFilter”Filters by comparing a field to a range of numeric values.
Filter schema
Section titled “Filter schema”Property | Type | Description |
---|---|---|
operator | RangeOperators | The operator to apply to the filter value |
value | range object | The value to use for the filter operation |
Range object
Section titled “Range object”Property | Type | Description |
---|---|---|
min | numeric | The minimum numeric value for this range |
max | numeric | The maximum numeric value for this range |
Formats
Section titled “Formats”A JSON example of this field is:
{ "operator": "within", "value": { "min": 1000, "max": 10000 }}
The JSON schema for this field is:
$schema: https://json-schema.org/draft/2020-12/schema$id: NumberRangeFilter.yamltype: objectproperties: operator: $ref: RangeOperators.yaml description: The operator to apply to the filter value value: type: object properties: min: type: number max: type: number required: - min - max examples: - min: 1000 max: 10000 description: The value to use for the filter operationrequired: - operator - valuedescription: Filters by comparing a field to a numeric range
The TypeSpec code for this field is:
/** Filters by comparing a field to a numeric range */model NumberRangeFilter { /** The operator to apply to the filter value */ operator: RangeOperators;
/** The value to use for the filter operation */ @example(#{ min: 1000, max: 10000 }) value: { min: numeric; max: numeric; };}
The Python code for this filter is:
from dataclasses import dataclass
@dataclassclass NumberRange: min: float max: float
@dataclassclass NumberRangeFilter: operator: RangeOperators value: NumberRange
# Example usage:number_range_filter = NumberRangeFilter( operator=RangeOperators.WITHIN, value=NumberRange( min=1000, max=10000 ))
NumberArrayFilter
Section titled “NumberArrayFilter”Filters by comparing a field to an array of numeric values.
Property | Type | Description |
---|---|---|
operator | ArrayOperators | The operator to apply to the filter value |
value | Array<numeric> | The value to use for the filter operation |
Formats
Section titled “Formats”A JSON example of this field is:
{ "operator": "in", "value": [1000, 2000, 3000]}
The JSON schema for this field is:
$schema: https://json-schema.org/draft/2020-12/schema$id: NumberArrayFilter.yamltype: objectproperties: operator: $ref: ArrayOperators.yaml description: The operator to apply to the filter value value: type: array items: type: number description: The value to use for the filter operationrequired: - operator - valuedescription: Filters by comparing a field to an array of numeric values
The TypeSpec code for this field is:
/** Filters by comparing a field to an array of numeric values */model NumberArrayFilter { /** The operator to apply to the filter value */ operator: ArrayOperators;
/** The value to use for the filter operation */ @example(#[1000, 2000, 3000]) value: Array<numeric>;}
The Python code for this filter is:
from dataclasses import dataclass
@dataclassclass NumberArrayFilter: operator: ArrayOperators value: list[float]
# Example usage:number_array_filter = NumberArrayFilter( operator=ArrayOperators.IN, value=[1000, 2000, 3000])