FieldFilterSchema
const FieldFilterSchema: Union<[Union<[mutable<Struct<{ kind: Literal<["text"]>; operator: SchemaClass< | "endsWith" | "startsWith" | "eq" | "ne" | "contains" | "like" | "ilike" | "notIlike", | "endsWith" | "startsWith" | "eq" | "ne" | "contains" | "like" | "ilike" | "notIlike", never>; value: typeof String$;}>>, mutable<Struct<{ kind: Literal<["text"]>; operator: SchemaClass<"inArray" | "notInArray", "inArray" | "notInArray", never>; values: mutable<Array$<typeof String$>>;}>>, mutable<Struct<{ kind: Literal<["text"]>; operator: SchemaClass<"isNull" | "isNotNull", "isNull" | "isNotNull", never>;}>>]>, Union<[mutable<Struct<{ kind: Literal<["number"]>; operator: SchemaClass<"eq" | "ne" | "lt" | "gt" | "lte" | "gte", "eq" | "ne" | "lt" | "gt" | "lte" | "gte", never>; value: typeof Number$;}>>, mutable<Struct<{ from: typeof Number$; kind: Literal<["number"]>; operator: SchemaClass<"between" | "notBetween", "between" | "notBetween", never>; to: typeof Number$;}>>, mutable<Struct<{ kind: Literal<["number"]>; operator: SchemaClass<"inArray" | "notInArray", "inArray" | "notInArray", never>; values: mutable<Array$<typeof Number$>>;}>>, mutable<Struct<{ kind: Literal<["number"]>; operator: SchemaClass<"isNull" | "isNotNull", "isNull" | "isNotNull", never>;}>>]>, Union<[mutable<Struct<{ kind: Literal<["enum"]>; operator: SchemaClass<"eq" | "ne", "eq" | "ne", never>; value: typeof String$;}>>, mutable<Struct<{ kind: Literal<["enum"]>; operator: SchemaClass<"inArray" | "notInArray", "inArray" | "notInArray", never>; values: mutable<Array$<typeof String$>>;}>>, mutable<Struct<{ kind: Literal<["enum"]>; operator: SchemaClass<"isNull" | "isNotNull", "isNull" | "isNotNull", never>;}>>]>]>;Defined in: filters/schemas-effect.ts:269
Validates any field filter (the model’s FieldFilter): the union of the six
per-kind schemas, so the operator must be valid for the kind.
Example
Section titled “Example”import { Schema } from "effect";import { FieldFilterSchema } from "@xtandard/lib/filters/effect";
const input = { kind: "number", operator: "gte", value: 10 };Schema.decodeUnknownSync(FieldFilterSchema)(input);// → `input`, typed as `FieldFilter`Schema.is(FieldFilterSchema)({ kind: "number", operator: "contains", value: "1" });// → false (`contains` isn't a number operator)