Installation
npm install --save @types/mongration
Summary
This package contains type definitions for mongration (https://github.com/awapps/mongration#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongration.
index.d.ts
import { Db } from "mongodb";
export interface DbConfig {
hosts?: string | undefined;
db?: string | undefined;
user?: string | undefined;
password?: string | undefined;
mongoUri?: string | undefined;
migrationCollection: string;
replicaSet?: string | undefined;
}
export interface MigrationResponse {
id: string;
status: "not-run" | "skipped" | "pending" | "ok" | "error" | "rollback" | "rollback-error";
}
export class Migration {
constructor(dbConfig: DbConfig);
add: (paths: string | string[]) => void;
addAllFromPath: (path: string) => void;
migrate: (doneCb?: (err: Error | null, response: MigrationResponse[]) => void) => void;
}
export interface MigrationStep {
id: string;
up: (db: Db, cb: (err?: Error) => void) => void;
down?: ((db: Db, cb: (err?: Error) => void) => void) | undefined;
}
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/node, mongodb
Credits
These definitions were written by Anton Lobashev.