@js-migrations/mongo

1.0.1 • Public • Published

mongo

Implementation of the js-migrations RepoFacade using Mongo.

Usage

  1. Install it with npm i @js-migrations/mongo.
  2. Use the factory to create the repository facade.
  3. Use the facade with the @js-migrations/core service.

Use the factory

import mongoMigrationsRepoFactory from '@js-migrations/mongo/dist/factory';
import connectToDb from '@js-migrations/mongo/dist/utils/connectToDb';

const migrationsRepoFacade = mongoMigrationsRepoFactory({
  db: connectToDb({
    dbName: 'your_db_name',
    url: 'mongodb://127.0.0.1',
  }),
  // Optional property.
  collectionName: 'migrations',
  // Optional property.
  lockCollectionName: 'migrationsLock',
  // Optional property.
  migrations: [{
    down: async () => {},
    key: 'your_migration_name',
    up: async () => {},
  }],
});

Readme

Keywords

none

Package Sidebar

Install

npm i @js-migrations/mongo

Weekly Downloads

1

Version

1.0.1

License

GPL-3.0

Unpacked Size

75.8 kB

Total Files

39

Last publish

Collaborators

  • ryansmith94