Skip to content

jesseokeya/Migrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongo Migrant

Perform mongoDb migrations easily

Getting Started

Installing

Install node dependecies required

npm install mongo-migrant --save

Inorder to use the command line tools you have to install mongo-migrant globally

npm install mongo-migrant -g

Usage

const Migrant = require('mongo-migrant')

const context = new Migrant({
    /** Database uri your migrating from  **/
    up: process.env.UP,
    /** Database uri our migrating to **/
    down: process.env.DOWN
})

/** performs database migration **/
context.migrate()

CLI Usage

Displays current version of mongo-migrant

mongo-migrant --version

Displays command line usage / docs

mongo-migrant --help

Performs mongo database migration

mongo-migrant --up='database_uri_your_migrating_from' --down='database_uri_your_migrating_to'

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • oclif
  • mongoClient