Skip to content

Commit

Permalink
fix: support callback with createConnection() and useMongoClient
Browse files Browse the repository at this point in the history
Re: #6217
  • Loading branch information
vkarpov15 committed Mar 9, 2018
1 parent cfad53b commit 2be24f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ var checkReplicaSetInUri = function(uri) {
* @api public
*/

Mongoose.prototype.createConnection = function(uri, options) {
Mongoose.prototype.createConnection = function(uri, options, callback) {
var conn = new Connection(this);
this.connections.push(conn);

var rsOption = options && (options.replset || options.replSet);

if (options && options.useMongoClient) {
return conn.openUri(uri, options);
return conn.openUri(uri, options, callback);
}

if (arguments.length) {
Expand Down

0 comments on commit 2be24f4

Please sign in to comment.