Options
All
  • Public
  • Public/Protected
  • All
Menu

Module typings

Type aliases

IndexedKey

IndexedKey<Document>: KeyOf<Document> | string

Indexed key of document. Can be expressed in dot notation for nested keys.

Type parameters

  • Document

KeyOf

KeyOf<Document>: Exclude<keyof Document, symbol | number>

Top level string key of document.

Type parameters

  • Document

Query

Query<Document>: IndexValue | QueryConditions<Document> | UnaryPredicate<Document>

Represents the query for documents, and can take one of the values:

Value type Query behaviour
IndexValue Search documents by their primary key.
QueryConditions Search documents by mongoose schema.
Only a limited subset of operators are supported.
UnaryPredicate Search documents by predicate function.

Type parameters

  • Document

SortFields

SortFields<Document>: Record<IndexedKey<Document>, SortDirection>

Sort order for found documents.
Documents will be sorted by specified fields, in the order they appear as keys in the object.

example
// Sorts ascending by `firstName`, then descending by `birthYear`.
const sortFields = {
    firstName: SortDirection.ASCENDING,
    birthYear: SortDirection.DESCENDING
};

Type parameters

  • Document

Variables

Const PK_INDEX_NAME

PK_INDEX_NAME: "id" = "id"

Defines the property name of the primary key.