Options
All
  • Public
  • Public/Protected
  • All
Menu

Implementation of {@link PersistenceAdapter} using MongoDB.

Hierarchy

  • MongoDBPersistenceAdapter

Implements

  • PersistenceAdapter

Index

Constructors

constructor

Properties

Protected collectionName

collectionName: string

Protected databaseName

databaseName: string

Protected mongoDB

mongoDB: Db

Protected mongoDBClient

mongoDBClient: MongoClient

Protected mongoURI

mongoURI: string

Protected partitionKeyGenerator

partitionKeyGenerator: PartitionKeyGenerator

Methods

Private checkResult

  • checkResult(data: any, attributesId: any): void

deleteAttributes

  • deleteAttributes(requestEnvelope: RequestEnvelope): Promise<void>
  • Delete persistence attributes from MongoDB.

    Parameters

    • requestEnvelope: RequestEnvelope

      Request envelope used to generate partition key.

    Returns Promise<void>

getAttributes

  • getAttributes(requestEnvelope: RequestEnvelope): Promise<Record<string, any>>
  • Retrieves persistence attributes from MongoDB.

    Parameters

    • requestEnvelope: RequestEnvelope

      Request envelope used to generate partition key.

    Returns Promise<Record<string, any>>

Private getMongoDBClient

  • getMongoDBClient(): Promise<void>

saveAttributes

  • saveAttributes(requestEnvelope: RequestEnvelope, attributes: Record<string, any>): Promise<void>
  • 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>

Generated using TypeDoc