Setu-TS
    Preparing search index...

    Interface IMongoClient

    A structural subset of the driver MongoClient — the members the adapter drives.

    0.2.0

    interface IMongoClient {
        close(): Promise<void>;
        connect(): Promise<unknown>;
        db(name: string): IMongoDatabase;
        startSession(): IMongoSession;
    }
    Index
    • Opens the connection.

      The resolved value is deliberately unknown rather than void: the real driver declares connect(): Promise<this> (mongodb.d.ts), and Promise<MongoClient> is not assignable to Promise<void>, so the typed void form made the documented injection arm a compile error for the one client it exists to accept (X47-1). The adapter discards the resolved value, so unknown is the widest return an implementation may specialise — a fake resolving void still satisfies it. The assignment is pinned by the compile-time fixture test/types/mongo-seam.assert.ts, which fails pnpm run check the moment this facade drifts from the driver again.

      Returns Promise<unknown>