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
* Simplify code: remove raw_find (raw_find called from cursors, raw_find called with "$cmd"), so raw_find is more calling a command than a find query.
17
-
* Better support for new MongoDB version, for example the ability to use views
18
-
* Upgrade to DBConnection 2.x
19
-
* Because the driver is used in production environments, quick adjustments are necessary.
21
+
*[ ] Refactoring old code into new
22
+
*[ ] Understand the magic in the code
23
+
*[x] Simplify code: remove raw_find (raw_find called from cursors, raw_find called with "$cmd"), so raw_find is more calling a command than a find query.
24
+
*[x] Better support for new MongoDB version, for example the ability to use views
25
+
*[x] Upgrade to ([DBConnection 2.x](https://github.com/elixir-ecto/db_connection))
26
+
*[x] Removed depreacated op codes ([See](https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#request-opcodes))
27
+
*[ ] Because the driver is used in production environments, quick adjustments are necessary.
@@ -57,25 +65,20 @@ to implement the current requirements for the driver.
57
65
58
66
### Installation:
59
67
60
-
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:
68
+
Add `mongodb_driver` to your mix.exs `deps` and `:applications`.
61
69
62
70
```elixir
63
71
defapplicationdo
64
-
[applications: [:mongodb, :poolboy]]
72
+
[applications: [:mongodb_driver]]
65
73
end
66
74
67
75
defpdepsdo
68
-
[{:mongodb, ">= 0.0.0"},
69
-
{:poolboy, ">= 0.0.0"}]
76
+
[{:mongodb_driver, "~> 0.5.0"}]
70
77
end
71
78
```
72
79
73
80
Then run `mix deps.get` to fetch dependencies.
74
81
75
-
### Connection pooling
76
-
77
-
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.
The driver supports pooling by DBConnection (2.x). By default `mongodb_driver` will start a single
96
+
connection, but it also supports pooling with the `:pool_size` option. For 3 connections add the `pool_size: 3` option to `Mongo.start_link` and to all
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.
This will allow for scenarios where the first `"hostname1.net:27017"` is unreachable for any reason and will automatically try to connect to each of the following entries in the list to connect to the cluster.
137
+
This will allow for scenarios where the first `"hostname1.net:27017"` is unreachable for any reason
138
+
and will automatically try to connect to each of the following entries in the list to connect to the cluster.
127
139
128
140
### Auth mechanisms
129
141
130
-
For versions of Mongo 3.0 and greater, the auth mechanism defaults to SCRAM. If you'd like to use [MONGODB-X509](https://docs.mongodb.com/manual/tutorial/configure-x509-client-authentication/#authenticate-with-a-x-509-certificate)
142
+
For versions of Mongo 3.0 and greater, the auth mechanism defaults to SCRAM.
143
+
If you'd like to use [MONGODB-X509](https://docs.mongodb.com/manual/tutorial/configure-x509-client-authentication/#authenticate-with-a-x-509-certificate)
131
144
authentication, you can specify that as a `start_link` option.
132
145
133
146
```elixir
@@ -136,7 +149,8 @@ authentication, you can specify that as a `start_link` option.
136
149
137
150
### AWS, TLS and Erlang SSL ciphers
138
151
139
-
Some MongoDB cloud providers (notably AWS) require a particular TLS cipher that isn't enabled by default in the Erlang SSL module. In order to connect to these services,
152
+
Some MongoDB cloud providers (notably AWS) require a particular TLS cipher that isn't enabled
153
+
by default in the Erlang SSL module. In order to connect to these services,
140
154
you'll want to add this cipher to your `ssl_opts`:
0 commit comments