interface MongoDatabaseOptions
Since 0.1.0

The arm selecting the Mongo adapter over the native mongodb driver.

options.url is required by the union unless options.client is supplied, so a registration that forgets both is a compile error instead of a connect() throw — the same guarantee the 'custom' arm gives adapter. The client is supplied inject-or-lazy (§12.2 of AI_GUIDELINES): client is an already-constructed structural IMongoClient, and absent it the adapter performs a literal import('npm:mongodb@^6.21.0') at connect time.

Examples

Example 1

import { DatabasePlugin } from '@setu-ts/database-plugin';

DatabasePlugin({
  type: 'mongodb',
  options: { url: 'mongodb://localhost:27017/mydb' },
});

Properties

readonly
type: "mongodb"

Selects the Mongo arm.

Mongo adapter configuration; url (or client) is required.

Usage

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