Skip to content

Commit faf15b6

Browse files
committed
updated documentation
1 parent e474f59 commit faf15b6

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

lib/mongo.ex

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ defmodule Mongo do
405405
Selects documents in a collection and returns a cursor for the selected
406406
documents.
407407
408-
For all options see https://docs.mongodb.com/manual/reference/command/find/#dbcmd.find
408+
For all options see [Options](https://docs.mongodb.com/manual/reference/command/find/#dbcmd.find)
409409
410410
Use the underscore style, for example to set the option `singleBatch` use `single_batch`. Another example:
411411
@@ -461,7 +461,7 @@ defmodule Mongo do
461461
If multiple documents satisfy the query, this method returns the first document
462462
according to the natural order which reflects the order of documents on the disk.
463463
464-
For all options see https://docs.mongodb.com/manual/reference/command/find/#dbcmd.find
464+
For all options see [Options](https://docs.mongodb.com/manual/reference/command/find/#dbcmd.find)
465465
466466
Use the underscore style, for example to set the option `readConcern` use `read_concern`. Another example:
467467
@@ -581,16 +581,12 @@ defmodule Mongo do
581581
@doc """
582582
Insert multiple documents into the collection.
583583
584-
If any of the documents is missing the `_id` field or it is `nil`, an ObjectId
585-
will be generated, and insertd into the document.
584+
If any of the documents is missing the `_id` field or it is `nil`, an ObjectId will be generated, and insertd into the document.
586585
Ids of all documents will be returned in the result struct.
587586
588587
## Options
589588
590-
* `:continue_on_error` - even if insert fails for one of the documents
591-
continue inserting the remaining ones (default: `false`)
592-
* `:ordered` - A boolean specifying whether the mongod instance should
593-
perform an ordered or unordered insert. (default: `true`)
589+
For more information about options see [Options](https://docs.mongodb.com/manual/reference/command/insert/)
594590
595591
## Examples
596592
@@ -618,14 +614,11 @@ defmodule Mongo do
618614
with {:ok, conn, _, _} <- select_server(topology_pid, :write, opts),
619615
{:ok, doc} <- direct_command(conn, query, opts) do
620616
case doc do
621-
%{"writeErrors" => _} ->
622-
{:error, %Mongo.WriteError{n: doc["n"], ok: doc["ok"], write_errors: doc["writeErrors"]}}
617+
%{"writeErrors" => _} -> {:error, %Mongo.WriteError{n: doc["n"], ok: doc["ok"], write_errors: doc["writeErrors"]}}
623618
_ ->
624619
case Map.get(write_concern, :w) do
625-
0 ->
626-
{:ok, %Mongo.InsertManyResult{acknowledged: false}}
627-
_ ->
628-
{:ok, %Mongo.InsertManyResult{inserted_ids: ids}}
620+
0 -> {:ok, %Mongo.InsertManyResult{acknowledged: false}}
621+
_ -> {:ok, %Mongo.InsertManyResult{inserted_ids: ids}}
629622
end
630623
end
631624
end
@@ -770,8 +763,7 @@ defmodule Mongo do
770763
Update all documents matching the filter.
771764
772765
Uses MongoDB update operators to specify the updates. For more information and all options
773-
please refer to the
774-
[MongoDB documentation](https://docs.mongodb.com/manual/reference/command/update/#dbcmd.update)
766+
please refer to the [MongoDB documentation](https://docs.mongodb.com/manual/reference/command/update/#dbcmd.update)
775767
776768
"""
777769
@spec update_many(GenServer.server, collection, BSON.document, BSON.document, Keyword.t) :: result(Mongo.UpdateResult.t)

0 commit comments

Comments
 (0)