Skip to content

Commit

Permalink
Update Readme with directions to activate zlib compression (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmessinger authored Nov 5, 2024
1 parent b575ba7 commit c60d7d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c60d7d1

Please sign in to comment.