From aa601d3f8ee5848d4dde056dda3776a36f884815 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Wed, 10 Oct 2018 18:13:30 -0400 Subject: [PATCH] fix(uri-parser): persist default database when authSource present --- lib/uri_parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/uri_parser.js b/lib/uri_parser.js index 47c16c5c9..507e40ebc 100644 --- a/lib/uri_parser.js +++ b/lib/uri_parser.js @@ -530,6 +530,10 @@ function parseConnectionString(uri, options, callback) { options: Object.keys(parsedOptions).length ? parsedOptions : null }; + if (result.auth && result.auth.db) { + result.defaultDatabase = result.auth.db; + } + try { applyAuthExpectations(result); } catch (authError) {