Create a numeric filter for range and exact matching on numeric fields.
This is a convenience function that provides a fluent API for building numeric filters. Numeric filters support range queries and exact matching on numerical values.
Num(field: string): __type| Name | Type | Description |
|---|---|---|
field* | string |
The name of the numeric field to filter on
// Exact match
const filter = Num("price").eq(99.99);
// Range queries
const filter = Num("price").between(50, 200);
const filter2 = Num("rating").gte(4.5);
const filter3 = Num("stock").gt(0);
// Combine with other filters
const complexFilter = Num("price").between(50, 200)
.and(Tag("category").eq("electronics"));