mongodb-migrations
mongodb-migrations copied to clipboard
support for promises in up/down functions
I'm using nodejs 6.9+ and would like to use built-in Promise libraries instead of done callback. So,
module.exports = {
up() {
return this.db.createCollection('tasks')
},
down() {
return this.db.dropCollection('tasks')
}
}
In future it will also support async functions and I'll be able to do this:
module.exports = {
async up() {
await this.db.createCollection('tasks')
},
async down() {
await this.db.dropCollection('tasks')
}
}
https://github.com/emirotin/mongodb-migrations/issues/65