@zakodium/adonis-mongodb
    Preparing search index...

    Interface ConnectionManagerContract

    Connection manager to manage database connections.

    interface ConnectionManagerContract {
        connections: Map<string, ConnectionNode>;
        add(connectionName: string, config: MongodbConnectionConfig): void;
        close(connectionName: string): Promise<void>;
        closeAll(): Promise<void>;
        connect(connectionName: string): void;
        get(connectionName: string): ConnectionNode;
        has(connectionName: string): boolean;
        isConnected(connectionName: string): boolean;
    }
    Index

    Properties

    connections: Map<string, ConnectionNode>

    List of registered connections.

    Methods

    • Close a connection.

      Parameters

      • connectionName: string

      Returns Promise<void>

    • Initiate a connection. It is a noop if the connection is already initiated.

      Parameters

      • connectionName: string

      Returns void

    • Returns whether the connection is managed by the manager.

      Parameters

      • connectionName: string

      Returns boolean

    • Returns whether the connection is connected.

      Parameters

      • connectionName: string

      Returns boolean