From 517dc32b69ea4f921937ec14b5f09f682768db17 Mon Sep 17 00:00:00 2001 From: "Cody B. Daig" Date: Sat, 15 Oct 2016 07:11:05 -0700 Subject: [PATCH] promise(core): Add Promise Option to Mongoose (#1560) Fixes #1559 --- config/env/default.js | 3 +++ config/lib/mongoose.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/config/env/default.js b/config/env/default.js index 9aeb343e49..8d7a1630d5 100644 --- a/config/env/default.js +++ b/config/env/default.js @@ -7,6 +7,9 @@ module.exports = { keywords: 'mongodb, express, angularjs, node.js, mongoose, passport', googleAnalyticsTrackingID: process.env.GOOGLE_ANALYTICS_TRACKING_ID || 'GOOGLE_ANALYTICS_TRACKING_ID' }, + db: { + promise: global.Promise, + }, port: process.env.PORT || 3000, host: process.env.HOST || '0.0.0.0', // DOMAIN config should be set to the fully qualified application accessible diff --git a/config/lib/mongoose.js b/config/lib/mongoose.js index f0c05daf39..4871ccf4dc 100644 --- a/config/lib/mongoose.js +++ b/config/lib/mongoose.js @@ -29,6 +29,8 @@ module.exports.connect = function (cb) { console.log(err); } else { + mongoose.Promise = config.db.promise; + // Enabling mongoose debug mode if required mongoose.set('debug', config.db.debug);