UNPKG

1.09 kBTypeScriptView Raw
1import type { UmzugStorage } from './contract';
2type AnyObject = Record<string, any>;
3export type MongoDBConnectionOptions = {
4 /**
5 A connection to target database established with MongoDB Driver
6 */
7 readonly connection: AnyObject;
8 /**
9 The name of the migration collection in MongoDB
10
11 @default 'migrations'
12 */
13 readonly collectionName?: string;
14};
15export type MongoDBCollectionOptions = {
16 /**
17 A reference to a MongoDB Driver collection
18 */
19 readonly collection: AnyObject;
20};
21export type MongoDBStorageConstructorOptions = MongoDBConnectionOptions | MongoDBCollectionOptions;
22export declare class MongoDBStorage implements UmzugStorage {
23 readonly collection: AnyObject;
24 readonly connection: any;
25 readonly collectionName: string;
26 constructor(options: MongoDBStorageConstructorOptions);
27 logMigration({ name: migrationName }: {
28 name: string;
29 }): Promise<void>;
30 unlogMigration({ name: migrationName }: {
31 name: string;
32 }): Promise<void>;
33 executed(): Promise<string[]>;
34}
35export {};