1

I am on Node 0.12.x working with the native Mongo driver. My original work was to promisify Mongo using Bluebird however I quickly realized that Mongo has built-in promises for the most part. This then led me to realize I have a built-in global Promise object to work with however I am unclear if this is native to JS or added by the es6 promise library that Mongo uses. Can someone clarify this? I am not sure which API docs to look at to see its features.

Roamer-1888
  • 19,138
  • 5
  • 33
  • 44
cyberwombat
  • 38,105
  • 35
  • 175
  • 251
  • Mongoose uses mpromise. You can (and probably should) use a library like bluebird until native promises become better supported and reasonably fast. – Benjamin Gruenbaum Aug 06 '15 at 19:39

1 Answers1

0

Native MongoDB driver is using es6-promise for deployment and bluebird for development https://github.com/mongodb/node-mongodb-native/blob/2.0/package.json

Both Node.js and io.js implementations of native promises are still incomplete, so you shouldn't rely on them.

bluebird is the most popular choice.

krl
  • 5,087
  • 4
  • 36
  • 53