import { EJSON } from 'bson'; import { SeederCollection, LogFn } from '../common'; /** * Populates collections from disk. */ export declare class CollectionPopulator { /** * Supported file extensions */ extensions: string[]; ejsonParseOptions: EJSON.Options; /** * Logger instance */ log: LogFn; /** * Constructs new `CollectionPopulator` object. * * @param extensions Array of file extensions */ constructor(extensions: string[], ejsonParseOptions: EJSON.Options, log?: LogFn); /** * Reads collections from path. * * @param path */ readFromPath(path: string): SeederCollection[]; /** * Read all collections from base path * * @param directories Array of directories names * @param inputDirectory Base directory */ private readCollections; private sortCollections; /** * Reads collection along with documents content from a given path. * * @param path Collection Path * @param directoryName Directory name */ private readCollection; /** * Populates MongoDB documents content by reading files. * * @param collectionPath Path for a single collection */ private populateDocumentsContent; /** * Reads collection name from directory name. * * @param directoryName Directory name */ private getCollectionMetadata; /** * Checks if a string is number. * * @param str String which can contain number */ private isNumber; }