Skip to content

Commit 1412056

Browse files
committed
fix(NODE-1837): remove zstc level option
1 parent 6992259 commit 1412056

File tree

6 files changed

+2
-38
lines changed

6 files changed

+2
-38
lines changed

src/cmap/connection.ts

-4
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,6 @@ function write(
795795
if (conn[kDescription].zlibCompressionLevel) {
796796
operationDescription.zlibCompressionLevel = conn[kDescription].zlibCompressionLevel;
797797
}
798-
799-
if (conn[kDescription].zstdCompressionLevel) {
800-
operationDescription.zstdCompressionLevel = conn[kDescription].zstdCompressionLevel;
801-
}
802798
}
803799

804800
if (typeof options.socketTimeoutMS === 'number') {

src/cmap/message_stream.ts

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export interface OperationDescription extends BSONSerializeOptions {
4040
socketTimeoutOverride?: boolean;
4141
agreedCompressor?: CompressorName;
4242
zlibCompressionLevel?: number;
43-
zstdCompressionLevel?: number;
4443
$clusterTime?: Document;
4544
}
4645

src/cmap/stream_description.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export class StreamDescription {
3636
__nodejs_mock_server__?: boolean;
3737

3838
zlibCompressionLevel?: number;
39-
zstdCompressionLevel?: number;
4039

4140
constructor(address: string, options?: StreamDescriptionOptions) {
4241
this.address = address;

src/cmap/wire_protocol/compression.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const uncompressibleCommands = new Set([
3434
]);
3535

3636
const MAX_COMPRESSOR_ID = 3;
37+
const ZSTD_COMPRESSION_LEVEL = 3;
3738

3839
// Facilitate compressing a message using an agreed compressor
3940
export function compress(
@@ -68,7 +69,7 @@ export function compress(
6869
if ('kModuleError' in ZStandard) {
6970
return callback(ZStandard['kModuleError']);
7071
}
71-
ZStandard.compress(dataToBeCompressed, self.options.zstdCompressionLevel).then(
72+
ZStandard.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL).then(
7273
buffer => callback(undefined, buffer),
7374
error => callback(error)
7475
);

src/connection_string.ts

-4
Original file line numberDiff line numberDiff line change
@@ -1210,10 +1210,6 @@ export const OPTIONS = {
12101210
default: 0,
12111211
type: 'int'
12121212
},
1213-
zstdCompressionLevel: {
1214-
default: 3,
1215-
type: 'int'
1216-
},
12171213
// Custom types for modifying core behavior
12181214
connectionType: { type: 'any' },
12191215
srvPoller: { type: 'any' },

src/mongo_client.ts

-27
Original file line numberDiff line numberDiff line change
@@ -127,32 +127,6 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
127127
compressors?: CompressorName[] | string;
128128
/** An integer that specifies the compression level if using zlib for network compression. */
129129
zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
130-
/** An integer specifying zstd compression level. */
131-
zstdCompressionLevel?:
132-
| 0
133-
| 1
134-
| 2
135-
| 3
136-
| 4
137-
| 5
138-
| 6
139-
| 7
140-
| 8
141-
| 9
142-
| 10
143-
| 11
144-
| 12
145-
| 13
146-
| 14
147-
| 15
148-
| 16
149-
| 17
150-
| 18
151-
| 19
152-
| 20
153-
| 21
154-
| 22
155-
| undefined;
156130
/** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */
157131
srvMaxHosts?: number;
158132
/**
@@ -684,7 +658,6 @@ export interface MongoOptions
684658
| 'tlsInsecure'
685659
| 'waitQueueTimeoutMS'
686660
| 'zlibCompressionLevel'
687-
| 'zstdCompressionLevel'
688661
>
689662
>,
690663
SupportedNodeConnectionOptions {

0 commit comments

Comments
 (0)