generator-express
generator-express copied to clipboard
Use bluebird as the promise engine for mongoose by default.
This would make the express-generator more stable since mpromise is deprecated.
mongoose.Promise = require('bluebird');
I will submit a pull request when I have it implemented.
Do you have any reference on mpromise being deprecated? I can't find anything
Mongoose was spitting out a warning about mpromise being deprecated and another promise library should be used. This warning stopped when I set
mongoose.Promise = require('bluebird');
It appears to be because that I'm using an exec method on a find.
I'm trying to nail down where the message comes from when I'm not using bluebird and instead the mpromise default.
This may be a simple case of sync vs. async and the mpromise library is not mean for async?
from Mongoose Promises for the MongoDB Driver
The mongoose.Promise property sets the promises mongoose uses. However, this does not affect the underlying MongoDB driver. If you use the underlying driver, for instance Model.collection.db.insert(), you need to do a little extra work to change the underlying promises library.
I'm looking into what it would take to add this as an option in the generator instead of making it a default setting.