Type Alias MongodbRateLimiterStorageAdapterSettings

MongodbRateLimiterStorageAdapterSettings: {
    client: MongoClient;
    collectionName?: string;
    collectionSettings?: CollectionOptions;
    database: Db;
    enableTransactions?: boolean;
    serde: ISerde<string>;
}

Configuration for MongodbRateLimiterStorageAdapter. Requires a MongoDB Db instance.

IMPORT_PATH: "@daiso-tech/core/rate-limiter/mongodb-rate-limiter-storage-adapter"

Type declaration

  • client: MongoClient

    The MongoDB MongoClient instance, required for transaction support.

  • OptionalcollectionName?: string

    Name of the MongoDB collection used to store rate-limiter state records.

    "rateLimiter"
    
  • OptionalcollectionSettings?: CollectionOptions

    Additional options passed when creating or accessing the MongoDB collection.

  • database: Db

    The MongoDB Db instance to store rate-limiter state in.

  • OptionalenableTransactions?: boolean

    When true, operations are wrapped in MongoDB transactions for atomicity. Requires a Replica Set or sharded cluster that supports transactions.

    true
    
  • serde: ISerde<string>

    Serde instance for serializing and deserializing rate-limiter state to and from strings.