Permalink
Browse files

fix(mongoose): fixing mongoose deprecation notice for promises lib (#…

…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`
1 parent f53db0f commit f8384040a4d3a583e8f8343b758a68cf710c6783 @lirantal lirantal committed on GitHub Dec 25, 2016
Showing with 2 additions and 2 deletions.
  1. +2 −2 config/lib/mongoose.js
@@ -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);

1 comment on commit f838404

@NotAmaan
NotAmaan commented on f838404 Jan 6, 2017 edited

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

Please sign in to comment.