@storehouse/mongodb - v3.0.0
    Preparing search index...

    Function getConnection

    • Retrieves the underlying MongoDB client connection from a manager in the registry.

      Parameters

      • registry: Registry

        The Storehouse registry containing registered managers

      • OptionalmanagerName: string

        Optional name of the manager. If omitted, uses the default manager

      Returns MongoClient

      The MongoDB client instance

      If the manager is not found in the registry

      If the connection is not an instance of MongoClient

      const client = getConnection(registry, 'mongodb');
      const admin = client.db().admin();
      const dbs = await admin.listDatabases();