Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Programmatic API #20

Closed
sjones6 opened this issue Aug 28, 2018 · 3 comments
Closed

Add Programmatic API #20

sjones6 opened this issue Aug 28, 2018 · 3 comments

Comments

@sjones6
Copy link

sjones6 commented Aug 28, 2018

This migration package looks great (and kudos for the 100% test coverage!).

Would you consider adding a programmatic API? For instance, something like the following:

const Migrate = require('migrate-mongo');
const migrationConfig = require('path/to/config.js');
const migrator = new Migrate(migrationConfig);

migrator.up().then(/* etc */)
migrator.down().then(/* etc */)
@seppevs
Copy link
Owner

seppevs commented Aug 31, 2018

Nice suggestion! I will look into this when I find the time. PR's are welcome as well.

seppevs pushed a commit that referenced this issue Oct 9, 2018
* Export database helper for use in programmatic API
* Expose config functions via programmatic API
* Use main export functions in bin
* Add Programmatic API docs

See: #30
See: #20
@seppevs
Copy link
Owner

seppevs commented Oct 9, 2018

Landed in 4.1.0 🎉

@sjones6
Copy link
Author

sjones6 commented Oct 31, 2018

@seppevs Awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants