https://github.com/jesseokeya/migrant
Perform mongoDb migrations easily
https://github.com/jesseokeya/migrant
cli-tool command-line-tool migration migration-tool mongoclient mongodb node-module nodejs npm-package
Last synced: 12 months ago
JSON representation
Perform mongoDb migrations easily
- Host: GitHub
- URL: https://github.com/jesseokeya/migrant
- Owner: jesseokeya
- License: mit
- Created: 2019-03-22T18:02:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T18:43:11.000Z (over 3 years ago)
- Last Synced: 2025-05-24T02:19:28.207Z (about 1 year ago)
- Topics: cli-tool, command-line-tool, migration, migration-tool, mongoclient, mongodb, node-module, nodejs, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mongo-migrant
- Size: 1.5 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```js
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
```sh
mongo-migrant --version
```
Displays command line usage / docs
```sh
mongo-migrant --help
```
Performs mongo database migration
```sh
mongo-migrant --up='database_uri_your_migrating_from' --down='database_uri_your_migrating_to'
```
## Authors
* **Jesse Okeya** - *Initial work* - [jesseokeya](https://github.com/jesseokeya)
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* oclif
* mongoClient