Class MongoDbBridge

A middleware that presets configurations for a MondoDB connection.

Hierarchy

  • MongoDbBridge

Constructors

Properties

client: null | MongoClient
dbUrl: string

Methods

  • Function

    connect

    Returns

    • A MongoClient that has been connected to the database

    Throws

    An error that is related to the connection to the database

    Parameters

    • mongoClient: MongoClient = ...

      A MongoClient that has already been initialized

    • testConnDb: string

      A database that should be used to test the database connection

    • logDb: boolean = true

      Indicating whether the database logger should be run

    Returns Promise<MongoClient>

  • Initializing the MongoClient with a configuration and a db schema, which specifies the field encryption details.

    Function

    csfleInital

    Returns

    • An initialized MongoDB Client

    Parameters

    • connectionOpt: MongoClientOptions = ...

      A configuration for the MongoClient.

    • schemaMapJsonPath: string

      A path that links to the Json file containing the field encryption details.

    Returns MongoClient

  • Setting all the options for the database connection.

    Function

    genConnectionOpt

    Throws

    SSL-related error

    Returns

    A well set configuration for the database connection.

    Returns MongoClientOptions

  • Initializing the MongoClient with a configuration

    Function

    initialDbClient

    Returns

    • An initialized MongoDB Client

    Parameters

    • connectionOpt: MongoClientOptions = ...

      A configuration for the MongoClient.

    Returns MongoClient