Class IndexWriter<TTables>

Type Parameters

Constructors

Accessors

Methods

Constructors

  • Type Parameters

    Parameters

    • opts: {
          getWinner: undefined | (<T, U>(docA: T, docB: U) => T | U);
          logger: undefined | Logger;
          mapDoc: undefined | ((doc: MapeoDocDecode, version: VersionIdObject) => MapeoDoc);
          sqlite: Database;
          tables: TTables[];
      }
      • getWinner: undefined | (<T, U>(docA: T, docB: U) => T | U)

        custom function to determine the "winner" of two forked documents. Defaults to choosing the document with the most recent updatedAt

      • logger: undefined | Logger
      • mapDoc: undefined | ((doc: MapeoDocDecode, version: VersionIdObject) => MapeoDoc)

        optionally transform a document prior to indexing. Can also validate, if an error is thrown then the document will not be indexed

      • sqlite: Database
      • tables: TTables[]

    Returns IndexWriter<TTables>

Accessors

Methods

  • Parameters

    • entries: Entry<"binary">[]

    Returns Promise<IndexedDocIds>

    map of indexed docIds by schemaName

  • Parameters

    Returns void