booleanField
const booleanField: (input) => MongoFieldSpec;Defined in: filters/mongo.ts:103
Allow-list a public field as a boolean filter (eq/ne/null checks) over a document
field path ("done").
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ path: string; } |
input.path |
string |
Returns
Section titled “Returns”Example
Section titled “Example”import { booleanField, buildFilter } from "@xtandard/lib/filters/mongo";
const { filter } = buildFilter({ spec: { done: booleanField({ path: "done" }) }, filters: [{ field: "done", filter: { kind: "boolean", operator: "eq", value: false } }],});// filter → { done: { $eq: false } }