Setu-TS
    Preparing search index...

    Interface MongoAdapterOptionsBase

    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.

    0.2.0

    interface MongoAdapterOptionsBase {
        collections?: Readonly<Record<string, MongoEntityMapping>>;
        database?: string;
        logQueries?: boolean;
        objectIdCtor?: IMongoObjectIdCtor;
    }

    Hierarchy

    Index
    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.

    new MongoAdapter({
    url: 'mongodb://127.0.0.1:27017/app',
    collections: { User: { collection: 'users', primaryKey: 'user_id', idType: 'raw' } },
    });

    0.1.0

    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.

    0.1.0

    logQueries?: boolean

    When true, log SQL queries to the registered logger.

    0.1.0

    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.

    0.1.0