Options
All
  • Public
  • Public/Protected
  • All
Menu

The EnmapProvider class.

EnmapProvider({ dataDir: path-to-enmap-storage, name: 'name-of-table' })

Type parameters

  • D

Hierarchy

  • EnmapProvider

Index

Constructors

Properties

__proto__: any
help: object
model: any

Methods

  • delete(key: string): D
  • Deletes a document in the db,returns an error if it doesn't exist

    memberof

    EnmapProvider

    Parameters

    • key: string

      The key of the document.

    Returns D

    The object should be null or undefined -_- or an error.

  • ensure(key: string, value: any): D
  • ensures a document exists in the db, creates a new document if it doesn't exist

    memberof

    EnmapProvider

    Parameters

    • key: string

      The key of the document.

    • value: any

      The value of the document.

    Returns D

    The object of the document.

  • get(key: string): D
  • Gets a document from the db / returns an error if not found.

    memberof

    EnmapProvider

    Parameters

    • key: string

      The key of the document.

    Returns D

    The document or an error.

  • set(key: string, value: any): D
  • sets a document from the db, returns an error if it exists

    memberof

    EnmapProvider

    Parameters

    • key: string

      The key of the document.

    • value: any

      The object value of the document.

    Returns D

    An error if document exists or creates the document.

  • update(key: string, value: any): D
  • updates a document from the db, returns an error if it doesn't exist (allows dot-notation)

    memberof

    EnmapProvider

    Parameters

    • key: string

      The key of the document.

    • value: any

      The new value of the document.

    Returns D

    The document or an error.