Skip to content

Commit

Permalink
fix(mongoose): fixing mongoose deprecation notice for promises librar…
Browse files Browse the repository at this point in the history
…y integration (#1690)

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 28, 2016
1 parent e2035f8 commit 008ec75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/config/lib/mongoose.js
Expand Up @@ -46,10 +46,11 @@ module.exports.seed = function(dbConnection) {
module.exports.connect = function() {
return new Promise(function (resolve, reject) {

// Attach Node.js native Promises library implementation to Mongoose
mongoose.Promise = config.db.promise;

mongoose.connect(config.db.uri, config.db.options)
.then(function() {
// Attach Node.js native Promises library implementation to Mongoose
mongoose.Promise = config.db.promise;

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

0 comments on commit 008ec75

Please sign in to comment.