Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fix(mongoose): fixing mongoose deprecation notice for promises lib (#…
Browse files Browse the repository at this point in the history
…1691)

If no promises library set correctly for the mongoose.Promise property then the following warning notice is omitted by mongoose:
`DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html`
  • Loading branch information
lirantal committed Dec 25, 2016
1 parent f53db0f commit f838404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/lib/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ module.exports.loadModels = function (callback) {
module.exports.connect = function (cb) {
var _this = this;

mongoose.Promise = config.db.promise;

var db = mongoose.connect(config.db.uri, config.db.options, function (err) {
// Log Error
if (err) {
console.error(chalk.red('Could not connect to MongoDB!'));
console.log(err);
} else {

mongoose.Promise = config.db.promise;

// Enabling mongoose debug mode if required
mongoose.set('debug', config.db.debug);

Expand Down

1 comment on commit f838404

@NotAmaan
Copy link

@NotAmaan NotAmaan commented on f838404 Jan 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lirantal Still see the warning, did this change fix it for you?

Please sign in to comment.