Skip to content

Commit

Permalink
fix(connect): use reported default databse from new uri parser
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Oct 10, 2018
1 parent 94fd6d8 commit 811f8f8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/operations/mongo_client_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,23 +555,29 @@ function transformUrlOptions(_object) {
object[i] = auth[i];
}
}

if (auth.username) {
object.auth = auth;
object.user = auth.username;
}
if (auth.db) {
object.dbName = auth.db;
}
}

if (_object.defaultDatabase) {
object.dbName = _object.defaultDatabase;
}

if (object.maxpoolsize) {
object.poolSize = object.maxpoolsize;
}

if (object.readconcernlevel) {
object.readConcern = { level: object.readconcernlevel };
}

if (object.wtimeoutms) {
object.wtimeout = object.wtimeoutms;
}

return object;
}

Expand Down

0 comments on commit 811f8f8

Please sign in to comment.