numberField
const numberField: (input) => DrizzleRqbFieldSpec;Defined in: filters/drizzle-rqb.ts:87
Allow-list a public field as a number filter over a numeric column, named by its Drizzle
schema property key ("total"). between becomes gte + lte.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ column: string; } |
input.column |
string |
Returns
Section titled “Returns”Example
Section titled “Example”import { buildWhere, numberField } from "@xtandard/lib/filters/drizzle-rqb";
const { where } = buildWhere({ spec: { total: numberField({ column: "total" }) }, filters: [{ field: "total", filter: { kind: "number", operator: "between", from: 10, to: 20 } }],});// where → { AND: [{ total: { gte: 10 } }, { total: { lte: 20 } }] }