Skip to content

Commit 008ec75

Browse files
committed
fix(mongoose): fixing mongoose deprecation notice for promises library 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`
1 parent e2035f8 commit 008ec75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/config/lib/mongoose.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ module.exports.seed = function(dbConnection) {
4646
module.exports.connect = function() {
4747
return new Promise(function (resolve, reject) {
4848

49+
// Attach Node.js native Promises library implementation to Mongoose
50+
mongoose.Promise = config.db.promise;
51+
4952
mongoose.connect(config.db.uri, config.db.options)
5053
.then(function() {
51-
// Attach Node.js native Promises library implementation to Mongoose
52-
mongoose.Promise = config.db.promise;
5354

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

0 commit comments

Comments
 (0)