Skip to content

Commit 4c1377f

Browse files
committed
fix: lb mode
1 parent 3ad094b commit 4c1377f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/utils.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,8 @@ export function uuidV4(): Buffer {
361361
*/
362362
export function maxWireVersion(topologyOrServer?: Connection | Topology | Server): number {
363363
if (topologyOrServer) {
364-
if (topologyOrServer.loadBalanced || topologyOrServer.serverApi?.version) {
365-
// Since we do not have a monitor in the load balanced mode,
366-
// we assume the load-balanced server is always pointed at the latest mongodb version.
367-
// There is a risk that for on-prem deployments
368-
// that don't upgrade immediately that this could alert to the
369-
// application that a feature is available that is actually not.
370-
// We also return the max supported wire version for serverAPI.
364+
if (topologyOrServer.serverApi?.version) {
365+
// We return the max supported wire version for serverAPI.
371366
return MAX_SUPPORTED_WIRE_VERSION;
372367
}
373368
if (topologyOrServer.hello) {

0 commit comments

Comments
 (0)