Skip to content

Commit

Permalink
Merge pull request #28676 from geoand/#28672
Browse files Browse the repository at this point in the history
Fix Liquibase + Mongodb connection string issue
  • Loading branch information
geoand authored Oct 19, 2022
2 parents 891df39 + 382cc78 commit 9505440
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public Liquibase createLiquibase() {
+ "${options}");
}
if (mongoClientConfig.credentials.authSource.isPresent()) {
connectionString += "?authSource=" + mongoClientConfig.credentials.authSource.get();
boolean alreadyHasQueryParams = connectionString.contains("?");
connectionString += (alreadyHasQueryParams ? "&" : "?") + "authSource="
+ mongoClientConfig.credentials.authSource.get();
}

Database database = DatabaseFactory.getInstance().openDatabase(connectionString,
Expand Down

0 comments on commit 9505440

Please sign in to comment.