From 421fe6e0f856d74a421f11b35ed72a4910811a3f Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Mon, 11 Jan 2021 11:24:57 -0500 Subject: [PATCH] fix: correct typeof check in checkSupportedServer (#2690) --- src/cmap/connect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmap/connect.ts b/src/cmap/connect.ts index 0d324c5418..5673180dce 100644 --- a/src/cmap/connect.ts +++ b/src/cmap/connect.ts @@ -41,7 +41,7 @@ function checkSupportedServer(ismaster: Document, options: ConnectionOptions) { ismaster.maxWireVersion >= MIN_SUPPORTED_WIRE_VERSION; const serverVersionLowEnough = ismaster && - (typeof ismaster.maxWireVersion === 'number' || ismaster.maxWireVersion instanceof Int32) && + (typeof ismaster.minWireVersion === 'number' || ismaster.minWireVersion instanceof Int32) && ismaster.minWireVersion <= MAX_SUPPORTED_WIRE_VERSION; if (serverVersionHighEnough) {