@@ -405,7 +405,7 @@ defmodule Mongo do
405
405
Selects documents in a collection and returns a cursor for the selected
406
406
documents.
407
407
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)
409
409
410
410
Use the underscore style, for example to set the option `singleBatch` use `single_batch`. Another example:
411
411
@@ -461,7 +461,7 @@ defmodule Mongo do
461
461
If multiple documents satisfy the query, this method returns the first document
462
462
according to the natural order which reflects the order of documents on the disk.
463
463
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)
465
465
466
466
Use the underscore style, for example to set the option `readConcern` use `read_concern`. Another example:
467
467
@@ -581,16 +581,12 @@ defmodule Mongo do
581
581
@ doc """
582
582
Insert multiple documents into the collection.
583
583
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.
586
585
Ids of all documents will be returned in the result struct.
587
586
588
587
## Options
589
588
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/)
594
590
595
591
## Examples
596
592
@@ -618,14 +614,11 @@ defmodule Mongo do
618
614
with { :ok , conn , _ , _ } <- select_server ( topology_pid , :write , opts ) ,
619
615
{ :ok , doc } <- direct_command ( conn , query , opts ) do
620
616
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" ] } }
623
618
_ ->
624
619
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 } }
629
622
end
630
623
end
631
624
end
@@ -770,8 +763,7 @@ defmodule Mongo do
770
763
Update all documents matching the filter.
771
764
772
765
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)
775
767
776
768
"""
777
769
@ spec update_many ( GenServer . server , collection , BSON . document , BSON . document , Keyword . t ) :: result ( Mongo.UpdateResult . t )
0 commit comments