You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-18Lines changed: 7 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,24 +59,25 @@ to implement the current requirements for the driver.
59
59
60
60
### Installation:
61
61
62
-
Add mongodb to your mix.exs `deps` and `:applications` (replace `>= 0.0.0` in `deps` if you want a specific version). Mongodb supports the same pooling libraries db_connection does (currently: no pooling, poolboy, and sbroker). If you want to use poolboy as pooling library you should set up your project like this:
62
+
Add mongodb_driver to your mix.exs `deps` and `:applications` (replace `>= 0.0.0` in `deps` if you want a specific version).
63
+
The driver supports pooling by db_connection (2.x). If you want to use pooling you should set up your project like this:
63
64
64
65
```elixir
65
66
defapplicationdo
66
-
[applications: [:mongodb, :poolboy]]
67
+
[applications: [:mongodb_driver]]
67
68
end
68
69
69
70
defpdepsdo
70
-
[{:mongodb, ">= 0.0.0"},
71
-
{:poolboy, ">= 0.0.0"}]
71
+
[{:mongodb_driver, "~> 0.5.0"}]
72
72
end
73
73
```
74
74
75
75
Then run `mix deps.get` to fetch dependencies.
76
76
77
77
### Connection pooling
78
78
79
-
By default mongodb will start a single connection, but it also supports pooling with the `:pool` option. For poolboy add the `pool: DBConnection.Poolboy` option to `Mongo.start_link` and to all function calls in `Mongo` using the pool.
79
+
By default mongodb will start a single connection, but it also supports pooling with the `:pool_size` option.
80
+
For 3 connections add the `pool_size: 3` option to `Mongo.start_link` and to all function calls in `Mongo` using the pool.
DBConnection.Poolboy defaults to [10 Poolboy connections](https://hexdocs.pm/db_connection/1.1.3/DBConnection.Poolboy.html#content), but you can change that with the `:pool_size` option:
Remember to specify the pool in each query. There is [some discussion](https://github.com/ankhers/mongodb/issues/175) on how to change this requirement.
0 commit comments