Skip to content

Commit 44f187c

Browse files
committed
feat: deprecate minWireVersion on ReadPreference
1 parent 1ee6708 commit 44f187c

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/read_preference.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export class ReadPreference {
6363
tags?: TagSet[];
6464
hedge?: HedgeOptions;
6565
maxStalenessSeconds?: number;
66+
/**
67+
* @deprecated This will be removed as dead code in the next major version.
68+
*/
6669
minWireVersion?: number;
6770

6871
public static PRIMARY = ReadPreferenceMode.primary;

src/sdam/server_selection.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,6 @@ export function readPreferenceServerSelector(readPreference: ReadPreference): Se
273273
servers: ServerDescription[],
274274
deprioritized: ServerDescription[] = []
275275
): ServerDescription[] {
276-
const commonWireVersion = topologyDescription.commonWireVersion;
277-
if (
278-
commonWireVersion &&
279-
readPreference.minWireVersion &&
280-
readPreference.minWireVersion > commonWireVersion
281-
) {
282-
throw new MongoCompatibilityError(
283-
`Minimum wire version '${readPreference.minWireVersion}' required, but found '${commonWireVersion}'`
284-
);
285-
}
286276

287277
if (topologyDescription.type === TopologyType.LoadBalanced) {
288278
return servers.filter(loadBalancerFilter);

src/sdam/topology.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ function isStaleServerDescription(
11061106

11071107
/**
11081108
* @public
1109-
* @deprecated This class will be removed as dead code.
1109+
* @deprecated This class will be removed as dead code in the next major version.
11101110
*/
11111111
export class ServerCapabilities {
11121112
maxWireVersion: number;

0 commit comments

Comments
 (0)