Skip to content

Commit

Permalink
fix: copy connection over to MongooseThenable
Browse files Browse the repository at this point in the history
Fix #3972
  • Loading branch information
vkarpov15 committed Mar 18, 2016
1 parent 12d3b53 commit 1441e6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@ Mongoose.prototype.__defineGetter__('connection', function() {
return this.connections[0];
});

Mongoose.prototype.__defineSetter__('connection', function(v) {
this.connections[0] = v;
});

/*!
* Driver depentend APIs
*/
Expand Down Expand Up @@ -731,6 +735,8 @@ function MongooseThenable(mongoose, promise) {
return mongoose[key].apply(mongoose, arguments);
};
})(key);
} else if (['connection', 'connections'].indexOf(key) !== -1) {
_this[key] = mongoose[key];
}
}
this.$opPromise = promise;
Expand Down

0 comments on commit 1441e6a

Please sign in to comment.