Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readme with directions to activate zlib compression #256

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading