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

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

Merged
merged 1 commit into from
Dec 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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