How to use the mongo-seeding.Seeder.Transformers function in mongo-seeding

To help you get started, we’ve selected a few mongo-seeding examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pkosiec / mongo-seeding / cli / src / index.ts View on Github external
private getCollectionReadingConfig = (
    options: CommandLineArguments,
  ): SeederCollectionReadingOptions => {
    const transformers = [];
    const replaceIdWithUnderscoreId =
      options['replace-id'] || process.env.REPLACE_ID === 'true';

    if (replaceIdWithUnderscoreId) {
      transformers.push(Seeder.Transformers.replaceDocumentIdWithUnderscoreId);
    }

    return {
      extensions: ['ts', 'js', 'json'],
      transformers,
    };
  };

mongo-seeding

The ultimate Node.js library for populating your MongoDB database.

MIT
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis