Version Compatibility
The following table lists the minimum supported driver and MongoDB Server version for each compression algorithm:
Enable Network Compression
To enable network compression for your MongoDB connection, install the required dependencies and specify the compression algorithms you want to use.
Install Dependencies
The following table lists each algorithm and the required dependencies, if any:
Compression Algorithm | Dependencies |
|---|---|
Snappy | Add the |
Zlib | None |
Zstandard | Add the |
Specify Compression Algorithms
You can enable compression for the connection to your MongoDB instance by specifying the algorithms in one of two ways:
Adding the parameter to your connection string.
Specifying the
compressorsoption in yourMongoClientOptions.
Specify compression algorithms using the following strings: