Options
All
  • Public
  • Public/Protected
  • All
Menu

Implementation of {@link PersistenceAdapter} using MongoDB.

Hierarchy

  • MongoDBPersistenceAdapter

Implements

  • PersistenceAdapter

Index

Constructors

constructor

  • Parameters

    • config: { collectionName: string; mongoDBClient?: MongoClient; mongoURI?: string; partitionKeyGenerator?: PartitionKeyGenerator }
      • collectionName: string
      • Optional mongoDBClient?: MongoClient
      • Optional mongoURI?: string
      • Optional partitionKeyGenerator?: PartitionKeyGenerator

    Returns MongoDBPersistenceAdapter

Properties

Protected collectionName

collectionName: 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
  • Parameters

    • data: any
    • attributesId: any

    Returns 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>
  • Returns 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