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

support for promises in up/down functions #44

Open
stalniy opened this issue Feb 25, 2017 · 2 comments
Open

support for promises in up/down functions #44

stalniy opened this issue Feb 25, 2017 · 2 comments

Comments

@stalniy
Copy link

stalniy commented Feb 25, 2017

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')
  }
}
@stalniy
Copy link
Author

stalniy commented Feb 25, 2017

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')
  }
}

amongouser added a commit to amongouser/mongodb-migrations that referenced this issue Jul 5, 2017
@KieronWiltshire
Copy link

#65

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