type alias MongoAdapterOptions
Since 0.1.0

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.

Examples

Example 1

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

Definition

(
MongoAdapterOptionsBase
& { readonly url: string; readonly client?: IMongoClient; }
)

| (
MongoAdapterOptionsBase
& { readonly client: IMongoClient; readonly url?: string; }
)

Usage

import { type MongoAdapterOptions } from "database-plugin/src/index.ts";