Skip to content

Commit c60d7d1

Browse files
Update Readme with directions to activate zlib compression (#256)
1 parent b575ba7 commit c60d7d1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,18 @@ The driver supports two compressors
574574
* zlib, which is supported by Erlang
575575
* zstd, which is optional and supported by https://github.com/silviucpp/ezstd bindings.
576576

577-
To activate zstd compression, simply add `{:ezstd, "~> 1.1"}` to the dependencies of your `mix.exs` file.
578-
The driver will provide the related code. After activating the zstd compressor can be used by appending
579-
the `compressors=zstd` to the URL connection string:
577+
To activate zlib compression:
578+
1. Append `compressors=zlib` to the URL connection string:
579+
```elixir
580+
{:ok, top} = Mongo.start_link(url: "mongodb://localhost:27017/db?compressors=zlib")
581+
```
582+
583+
To activate zstd compression:
584+
1. Add `{:ezstd, "~> 1.1"}` to the dependencies of your `mix.exs` file. The driver will provide the related code.
585+
2. Append `compressors=zstd` to the URL connection string:
580586

581587
```elixir
582-
{:ok, top} = Mongo.start_link(url: "mongodb://localhost:27017/my_database?compressors=zstd&maxPoolSize=10")
588+
{:ok, top} = Mongo.start_link(url: "mongodb://localhost:27017/db?compressors=zstd")
583589
```
584590

585591
The driver uses compression for the following functions:

0 commit comments

Comments
 (0)