Skip to content

Commit

Permalink
fix: make setDriver() set correct reference to default connection `…
Browse files Browse the repository at this point in the history
…models`

Re: #12052
  • Loading branch information
vkarpov15 committed Jul 7, 2022
1 parent 38865df commit a1d88e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Mongoose.prototype.setDriver = function setDriver(driver) {

const Connection = driver.getConnection();
_mongoose.connections = [new Connection(_mongoose)];
_mongoose.connections[0].models = _mongoose.models;

return _mongoose;
};
Expand Down

0 comments on commit a1d88e5

Please sign in to comment.