From fd9f43dd74ba127c3633ab0d6d6bb660144ade6f Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Mon, 11 Jan 2021 10:21:31 -0500 Subject: [PATCH] fix: correct typeof check in checkSupportedServer --- 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 0d324c5418e..5673180dceb 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) {