Implementation of PersistenceAdapter using MongoDB.

Implements

  • PersistenceAdapter

Constructors

Properties

collectionName: string
databaseName: undefined | string
mongoDB: undefined | Db
mongoDBClient: undefined | MongoClient
mongoURI: undefined | string
partitionKeyGenerator: PartitionKeyGenerator

Methods

  • Delete persistence attributes from MongoDB.

    Parameters

    • requestEnvelope: RequestEnvelope

      Request envelope used to generate partition key.

    Returns Promise<void>

  • Retrieves persistence attributes from MongoDB.

    Parameters

    • requestEnvelope: RequestEnvelope

      Request envelope used to generate partition key.

    Returns Promise<Record<string, any>>

  • Saves persistence attributes to MongoDB.

    Parameters

    • requestEnvelope: RequestEnvelope

      Request envelope used to generate partition key.

    • attributes: Record<string, any>

      Attributes to be saved to MongoDB.

    Returns Promise<void>