Skip to content

Commit

Permalink
Update MongoBackendImpl.java
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega authored Aug 1, 2024
1 parent e7be92d commit b8712ec
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,17 @@ private MongoDatabase getDatabase(String dbName) {
.sslContext(sslContext)
.build();
}
client = new MongoClient(servers, credential, options);
if (servers.size() == 1) { // allow auto-discover when just one endpoint is provided
client = new MongoClient(servers.get(0), credential, options);
} else {
client = new MongoClient(servers, credential, options);
}
} else {
client = new MongoClient(servers, options);
if (servers.size() == 1) { // allow auto-discover when just one endpoint is provided
client = new MongoClient(servers.get(0), options);
} else {
client = new MongoClient(servers, options);
}
} // if else
} // if

Expand Down

0 comments on commit b8712ec

Please sign in to comment.