We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94fd6d8 commit 811f8f8Copy full SHA for 811f8f8
lib/operations/mongo_client_ops.js
@@ -555,23 +555,29 @@ function transformUrlOptions(_object) {
555
object[i] = auth[i];
556
}
557
558
+
559
if (auth.username) {
560
object.auth = auth;
561
object.user = auth.username;
562
- if (auth.db) {
563
- object.dbName = auth.db;
564
- }
565
+ if (_object.defaultDatabase) {
566
+ object.dbName = _object.defaultDatabase;
567
+ }
568
569
if (object.maxpoolsize) {
570
object.poolSize = object.maxpoolsize;
571
572
573
if (object.readconcernlevel) {
574
object.readConcern = { level: object.readconcernlevel };
575
576
577
if (object.wtimeoutms) {
578
object.wtimeout = object.wtimeoutms;
579
580
581
return object;
582
583
0 commit comments