To utilize the MongodbLockAdapter, you must install the "mongodb" package.

Note in order to use MongodbLockAdapter correctly, ensure you use a single, consistent database across all server instances.

IMPORT_PATH: "@daiso-tech/core/lock/implementations/adapters"

Implements

Constructors

Methods

  • The refresh method will upadte expiration of lock if it matches the given key and matches the given owner. Returns number of updated rows or documents.

    Parameters

    • key: string
    • owner: string
    • expiration: Date

    Returns Promise<number>

  • The update method will update a lock if it has expired, matches the given key and matches the given owner. Returns number of updated rows or documents.

    Parameters

    • key: string
    • owner: string
    • expiration: null | Date

    Returns Promise<number>