S

Loading…

Type Alias

IndexDefinition

How to build an index, passed to SinterCollection.createIndex.

Give field (and optionally direction) for an index on one field, or keys for a compound index on several fields in order.

type IndexDefinition<TDocument extends object = Document> = IndexDefinitionOptions & (
  | {
    readonly direction?: 1 | -1;
    readonly field: IndexablePath<TDocument>;
    readonly keys?: never;
  }
  | {
    readonly direction?: never;
    readonly field?: never;
    readonly keys: readonly (readonly [IndexablePath<TDocument>, 1 | -1])[];
  })

Defined in packages/driver/src/indexes.ts:40

Used by#