Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

Readonly db

db: Nedb<any>

Methods

convertTo

  • convertTo<T, O>(func: (input: T) => O): (doc: T) => O
  • Convenience method to convert a document to something.

    Type parameters

    • T

    • O

    Parameters

    • func: (input: T) => O

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

        • (input: T): O
        • Parameters

          • input: T

          Returns O

    Returns (doc: T) => O

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

      • (doc: T): O
      • Parameters

        • doc: T

        Returns O

delete

  • delete(query: Query): Promise<number>

getActivitySet

insert

  • insert(objects: unknown): Promise<any[]>

insertIfNotExists

  • insertIfNotExists(query: Query, insertObj: Record<string, unknown>): Promise<void>

select

  • select<T, O>(query: Query, transformFn?: (input: T) => O): Promise<O[]>

selectOne

  • selectOne<T, O>(query: Query, transformFn?: (input: T) => O): Promise<null | O>

setUnique

  • setUnique(fieldName: string, sparse?: boolean): void
  • 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

storeUserActivity

  • storeUserActivity(mxid: string, activity: UserActivity): Promise<void>

update

  • update(query: Query, updateVals: Record<string, unknown>): Promise<void>

upsert

  • upsert<T>(query: Query, updateVals: T): Promise<void>

Generated using TypeDoc