Construct a store suitable for event mapping information. Data is stored as StoredEvents.

Param: db

The connected NEDB database instance

Hierarchy (view full)

Constructors

Properties

db: Nedb<any>

Methods

  • Convenience method to convert a document to something.

    Type Parameters

    • T

    • O

    Parameters

    • func: ((input) => O)

      The function which will be called with a single document object. Guaranteed not to be null.

        • (input): O
        • Parameters

          • input: T

          Returns O

    Returns ((doc) => O)

    A transformFn function to pass to the standard select/delete/upsert/etc methods.

      • (doc): O
      • Parameters

        • doc: T

        Returns O

  • Get an existing event based on the provided matrix IDs.

    Parameters

    • roomId: string

      The ID of the room.

    • eventId: string

      The ID of the event.

    Returns Promise<null | StoredEvent>

    A promise which resolves to the StoredEvent or null.

  • Get an existing event based on the provided remote IDs.

    Parameters

    • roomId: string

      The ID of the room.

    • eventId: string

      The ID of the event.

    Returns Promise<null | StoredEvent>

    A promise which resolves to the StoredEvent or null.

  • Remove entries based on the matrix IDs.

    Parameters

    • roomId: string

      The ID of the room.

    • eventId: string

      The ID of the event.

    Returns Promise<number>

  • Remove entries based on the matrix IDs.

    Parameters

    • roomId: string

      The ID of the room.

    • eventId: string

      The ID of the event.

    Returns Promise<number>

  • Set a UNIQUE key constraint on the given field.

    Parameters

    • fieldName: string

      The field name. Use dot notation for nested objects.

    • sparse: boolean = false

      Allow sparse entries (undefined won't cause a key violation).

    Returns void

  • UPDATE a single document. If the document already exists, this will NOT update it.

    Parameters

    • query: Query
    • updateVals: Record<string, unknown>

    Returns Promise<void>

Generated using TypeDoc