interface MongoAdapterOptionsBase
extends Pick<DatabaseAdapterOptions, "logQueries">
Since 0.1.0

The options both MongoAdapterOptions arms share — everything that is optional regardless of how the client is supplied.

It is exported because the arms below reference it, so a caller building a configuration incrementally can name the shared half.

Properties

Since 0.1.0
readonly
optional
objectIdCtor: IMongoObjectIdCtor

The driver's ObjectId constructor when MongoAdapterOptions.client is injected.

A MongoClient instance does not expose the driver's ObjectId class. Supplying it preserves the adapter's _id conversion for injected clients while still avoiding a lazy driver import. It is not needed on the lazy path because that import supplies the constructor.

Since 0.1.0
readonly
optional
database: string

The database the collections live in.

Absent, the one encoded in url is used; absent from both, connect() fails at startup naming the option.

Since 0.1.0
readonly
optional
collections: Readonly<Record<string, MongoEntityMapping>>

Per-entity collection and primary-key overrides, keyed by the entity name passed to getRepository().

An entity with no entry uses its own name as the collection and 'id' as the key, which is why the zero-config path works for a schema whose collection names already match — the D1 two-layer shape.

Usage

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