Skip to content

Commit 483eb2e

Browse files
committed
chore: update README.md
1 parent 64e274a commit 483eb2e

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Add `mongodb_driver` to your mix.exs `deps`.
3737

3838
```elixir
3939
defp deps do
40-
[{:mongodb_driver, "~> 0.9.2"}]
40+
[{:mongodb_driver, "~> 1.0.0"}]
4141
end
4242
```
4343

@@ -322,8 +322,8 @@ Of course, using the `Mongo.Collection` is not free. When loading and saving, th
322322

323323
## Breaking changes
324324

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
327327
you can do:
328328

329329
l = Label.load(doc)
@@ -371,7 +371,7 @@ For more information check out the `Mongo.Repo` module documentation and the `Mo
371371

372372
## Breaking changes
373373

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
375375
for some query that used only the attributes of the document. In the case of nested documents, it didn't work, so
376376
it is changed to be more consistent. The Repo module is very simple without any query rewriting like Ecto does. In the case
377377
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:
388388
end
389389
end
390390

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:
392392

393393
MyApp.Repo.get_by(MyApp.Session, %{uuid: session_uuid})
394394

395395
because the `get_by/2` function uses the query parameter without any rewriting. You need to change the query:
396396

397397
MyApp.Repo.get_by(MyApp.Session, %{u: session_uuid})
398398

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.
400400

401401
## Logging
402402

@@ -614,6 +614,24 @@ For more information see:
614614
- `Mix.Tasks.Mongo`
615615
- https://hexdocs.pm/mix/1.14/Mix.Tasks.Release.html
616616

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+
617635
## Auth Mechanisms
618636

619637
For versions of Mongo 3.0 and greater, the auth mechanism defaults to SCRAM.

0 commit comments

Comments
 (0)