@@ -37,7 +37,7 @@ Add `mongodb_driver` to your mix.exs `deps`.
37
37
38
38
``` elixir
39
39
defp deps do
40
- [{:mongodb_driver , " ~> 0.9.2 " }]
40
+ [{:mongodb_driver , " ~> 1.0.0 " }]
41
41
end
42
42
```
43
43
@@ -322,8 +322,8 @@ Of course, using the `Mongo.Collection` is not free. When loading and saving, th
322
322
323
323
## Breaking changes
324
324
325
- Prior to version 0.9 .2 the dump function returns atoms as key. Since the dump function is the inverse function of load,
326
- which uses binary keys as default, the dump function should return binary keys as well. This increases the consistency and
325
+ Prior to version 0.9 .2 the dump function returns atoms as key. Since the ` dump/ 1 ` function is the inverse function of ` load/ 1 ` ,
326
+ which uses binary keys as default, the ` dump/ 1 ` function should return binary keys as well. This increases the consistency and
327
327
you can do:
328
328
329
329
l = Label .load (doc)
@@ -371,7 +371,7 @@ For more information check out the `Mongo.Repo` module documentation and the `Mo
371
371
372
372
## Breaking changes
373
373
374
- Prior to version 0.9.2 some Repo functions use the dump function for the query parameter. This worked only
374
+ Prior to version 0.9.2 some Repo functions use the ` dump/1 ` function for the query (and update) parameter. This worked only
375
375
for some query that used only the attributes of the document. In the case of nested documents, it didn't work, so
376
376
it is changed to be more consistent. The Repo module is very simple without any query rewriting like Ecto does. In the case
377
377
you want to use the ` :name ` option, you need to specify the query and updates in the Repo following
@@ -388,15 +388,15 @@ the specification in the MongoDB. Example:
388
388
end
389
389
end
390
390
391
- If you use the Repo module and want to fetch a specific session document, this won't work
391
+ If you use the Repo module and want to fetch a specific session document, this won't work:
392
392
393
393
MyApp.Repo.get_by(MyApp.Session, %{uuid: session_uuid})
394
394
395
395
because the ` get_by/2 ` function uses the query parameter without any rewriting. You need to change the query:
396
396
397
397
MyApp.Repo.get_by(MyApp.Session, %{u: session_uuid})
398
398
399
- A rewriting is too complex for now, because the MongoDB has a lot of options.
399
+ A rewriting is too complex for now because MongoDB has a lot of options.
400
400
401
401
## Logging
402
402
@@ -614,6 +614,24 @@ For more information see:
614
614
- ` Mix.Tasks.Mongo `
615
615
- https://hexdocs.pm/mix/1.14/Mix.Tasks.Release.html
616
616
617
+ ### Configuration:
618
+ You need to configure the migration module and specify at least the ` :otp_app ` and ` :topology ` values:
619
+
620
+ config :mongodb_driver,
621
+ migration:
622
+ [
623
+ topology: :mongo,
624
+ collection: "migrations",
625
+ path: "mongo/migrations",
626
+ otp_app: :mongodb_driver
627
+ ]
628
+
629
+ The following options are available:
630
+ * ` :collection ` - Version numbers of migrations will be saved in a collection named ` migrations ` by default.
631
+ * ` :path ` - the priv directory for migrations. ` :path ` defaults to "mongo/migrations" and migrations should be placed at "priv/mongo/migrations"
632
+ * ` :otp_app ` - the name of the otp_app to resolve the ` priv ` folder, defaults to ` :mongodb_driver ` . In most cases you use your application name.
633
+ * ` :topology ` - the topology for running the migrations, ` :topology ` defaults to ` :mongo `
634
+
617
635
## Auth Mechanisms
618
636
619
637
For versions of Mongo 3.0 and greater, the auth mechanism defaults to SCRAM.
0 commit comments