1 | import { Database } from '../database';
|
2 | import { SeederCollection, LogFn } from '../common';
|
3 | import { CollectionInsertManyOptions } from 'mongodb';
|
4 |
|
5 |
|
6 |
|
7 | export declare class CollectionImporter {
|
8 | |
9 |
|
10 |
|
11 | db: Database;
|
12 | |
13 |
|
14 |
|
15 | log: LogFn;
|
16 | |
17 |
|
18 |
|
19 | collectionInsertManyOptions?: CollectionInsertManyOptions;
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | constructor(db: Database, collectionInsertManyOptions?: CollectionInsertManyOptions, log?: LogFn);
|
27 | /**
|
28 | * Imports multiple collections into database.
|
29 | *
|
30 | * @param collections Array of collections
|
31 | */
|
32 | import(collections: SeederCollection[]): Promise<void>;
|
33 | /**
|
34 | * Imports single collection into database.
|
35 | *
|
36 | * @param collection Collection definition
|
37 | */
|
38 | private importCollection;
|
39 | }
|