Setu-TS
    Preparing search index...

    Type Alias MongoAdapterOptions

    MongoAdapterOptions:
        | MongoAdapterOptionsBase & { client?: IMongoClient; url: string }
        | MongoAdapterOptionsBase & { client: IMongoClient; url?: string }

    Options for the MongoAdapter — the 'mongodb' arm.

    A union of two arms, so supplying neither url nor client is a compile error rather than a connect() throw — the guarantee every other built-in arm gives ('prisma' requires prismaClient, 'drizzle' requires both Drizzle options, 'custom' requires adapter). Both members stay readable on either arm, so the adapter reads options.url and options.client without narrowing first.

    Type Declaration

    • MongoAdapterOptionsBase & { client?: IMongoClient; url: string }
      • Optional Readonlyclient?: IMongoClient

        An already-constructed client; omit it to load the driver lazily.

      • Readonlyurl: string

        The connection string used to construct a client when none is injected.

        The database the collections live in is taken from database when present, otherwise the database encoded in this URI.

    • MongoAdapterOptionsBase & { client: IMongoClient; url?: string }
      • Readonlyclient: IMongoClient

        An already-constructed IMongoClient.

        When present, the lazy import('mongodb') never runs — the seam that keeps the branching unit-testable.

      • Optional Readonlyurl?: string

        The connection string; unread once a client is injected.

    const lazy: MongoAdapterOptions = { url: 'mongodb://127.0.0.1:27017/app' };
    const injected: MongoAdapterOptions = { client: myMongoClient, database: 'app' };

    0.2.0