Skip to main content

Type Alias: FieldInput

FieldInput = { attrs?: TextFieldAttrs; name: string; path?: string; type: "text"; } | { attrs?: TagFieldAttrs; name: string; path?: string; type: "tag"; } | { attrs?: NumericFieldAttrs; name: string; path?: string; type: "numeric"; } | { attrs?: GeoFieldAttrs; name: string; path?: string; type: "geo"; } | { attrs?: VectorFieldAttrs; name: string; path?: string; type: "vector"; } | { attrs?: Record<string, unknown>; name: string; path?: string; type: string; }

Defined in: schema/schema.ts:133

Field input type for addField and addFields methods.

The attrs property is type-safe based on the field type:

  • text: TextFieldAttrs
  • tag: TagFieldAttrs
  • numeric: NumericFieldAttrs
  • geo: GeoFieldAttrs
  • vector: VectorFieldAttrs (FLAT or HNSW)