From c60d7d10b2b91d94db1cdc0618203ea4cc594790 Mon Sep 17 00:00:00 2001 From: Scott Ames-Messinger Date: Tue, 5 Nov 2024 02:26:57 -0500 Subject: [PATCH] Update Readme with directions to activate zlib compression (#256) --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ed89a7..3308e58 100644 --- a/README.md +++ b/README.md @@ -574,12 +574,18 @@ The driver supports two compressors * zlib, which is supported by Erlang * zstd, which is optional and supported by https://github.com/silviucpp/ezstd bindings. -To activate zstd compression, simply add `{:ezstd, "~> 1.1"}` to the dependencies of your `mix.exs` file. -The driver will provide the related code. After activating the zstd compressor can be used by appending -the `compressors=zstd` to the URL connection string: +To activate zlib compression: +1. Append `compressors=zlib` to the URL connection string: +```elixir +{:ok, top} = Mongo.start_link(url: "mongodb://localhost:27017/db?compressors=zlib") +``` + +To activate zstd compression: +1. Add `{:ezstd, "~> 1.1"}` to the dependencies of your `mix.exs` file. The driver will provide the related code. +2. Append `compressors=zstd` to the URL connection string: ```elixir -{:ok, top} = Mongo.start_link(url: "mongodb://localhost:27017/my_database?compressors=zstd&maxPoolSize=10") +{:ok, top} = Mongo.start_link(url: "mongodb://localhost:27017/db?compressors=zstd") ``` The driver uses compression for the following functions: