Skip to content

@iamcalegari/mongoat / MigrationContext

Interface: MigrationContext

Defined in: src/types/migrate.ts:64

The object passed into a migration's up/down function.

db and session are the native MongoDB driver types (no ODM wrapper) — a migration author gets the exact same escape-hatch surface Mongoat itself exposes via Database#getDb/Database#getClient, plus a running session already attached to the migration's transaction. schema offers convenience helpers for applying a validator or index set to a collection from a Model, a decorated schema class, or a plain schema object.

Properties

db

db: Db

Defined in: src/types/migrate.ts:65


schema

schema: MigrationSchemaHelpers

Defined in: src/types/migrate.ts:66


session

session: ClientSession

Defined in: src/types/migrate.ts:67