Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix(uri-parser): persist default database when authSource present
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Oct 10, 2018
1 parent f1eb0df commit aa601d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/uri_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit aa601d3

Please sign in to comment.