While this project is fully functional, the dependencies are no longer up to date. You are still welcome to explore, learn, and use the code provided here.
Modus is dedicated to supporting the community with innovative ideas, best-practice patterns, and inspiring open source solutions. Check out the latest Modus Labs projects.
In your app require the module
var mongo-migrate-schema = require('mongo-migrate-schema');And then call update function with options argument
mongo-migrate-schema.update({
dbUri:'mongodb://localhost:27017/test'
folder:__dirname + '/db'
});In the given folder, put your update files.
Each file must be named following this pattern :
|
Note
|
[number]_[desciption].js Example : 001_add_creation_date_field_default_value_today.js |
Each file must export a function called execute
module.exports.execute = function (db, fn) {
fn();
};