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

[v2] MEAN.JS API - fix(mongoose): fixing mongoose deprecation notice for promises #1690

Merged
merged 1 commit into from
Dec 26, 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
5 changes: 3 additions & 2 deletions server/config/lib/mongoose.js
Original file line number Diff line number Diff line change
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