Docs Home → Develop Applications → MongoDB Drivers → C#/.NET
Network Compression
You can enable a driver option to compress messages, which reduces the amount of data passed over the network between MongoDB and your application.
The .NET/C# Driver supports the following compression algorithms:
Snappy: available in MongoDB 3.6 and later.
Zlib: available in MongoDB 3.6 and later.
Zstandard: available in MongoDB 4.2 and later.
If you specify multiple compression algorithms, the driver selects the first one in the list supported by your MongoDB instance.
Specify Compression Algorithms
To enable compression for the connection to your MongoDB instance, specify the algorithms you want to use in one of the following ways:
Add the algorithms to your connection string as a parameter
Specify the algorithms in the
Compressors
property of yourMongoClientSettings
object