textField
const textField: <Row>(input) => MemoryFieldSpec<Row>;Defined in: filters/memory.ts:106
Allow-list a public field as a text filter over a row value read by path (a key, a dot
path, or a getter). contains/startsWith/endsWith match the input literally and ignore
case; like/ilike/notIlike take a SQL pattern (%, _, \ escapes). How case is
folded follows dialect (see MemoryDialect).
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Row |
any |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ path: MemoryAccessor<Row>; } |
input.path |
MemoryAccessor<Row> |
Returns
Section titled “Returns”MemoryFieldSpec<Row>
Example
Section titled “Example”import { buildFilterPredicate, textField } from "@xtandard/lib/filters/memory";
const { predicate } = buildFilterPredicate({ spec: { city: textField({ path: "address.city" }) }, filters: [{ field: "city", filter: { kind: "text", operator: "contains", value: "LIM" } }],});predicate({ address: { city: "Lima" } }); // → truepredicate({ address: null }); // → false