Skip to main content
Version: v10.0.0

FieldWhereDeclaration

How one field's operators reach the backend. true uses the db-wide default notation.


Import
import { FieldWhereDeclaration } from "@hyper-fetch/db"

Preview​

type FieldWhereDeclaration<Value,Req> = { eq?: ((value: Value) => RequestPatch<Req> | true); gt?: ((value: NonNullable<Value>) => RequestPatch<Req> | true); gte?: ((value: NonNullable<Value>) => RequestPatch<Req> | true); inArray?: ((values: Value[]) => RequestPatch<Req> | true); lt?: ((value: NonNullable<Value>) => RequestPatch<Req> | true); lte?: ((value: NonNullable<Value>) => RequestPatch<Req> | true); required?: true } & {};

Structure​

FieldWhereDeclaration
NameTypeDescription
eq
(value: Value) => RequestPatch<Req> | true
gt
(value: NonNullable<Value>) => RequestPatch<Req> | true
gte
(value: NonNullable<Value>) => RequestPatch<Req> | true
inArray
(values: Value[]) => RequestPatch<Req> | true
lt
(value: NonNullable<Value>) => RequestPatch<Req> | true
lte
(value: NonNullable<Value>) => RequestPatch<Req> | true
required
true

The endpoint cannot work without this filter, such as teamId in /teams/:teamId/posts