@@ -1051,7 +1051,7 @@ defmodule Mongo do
1051
1051
* `:upsert` - if set to `true` creates a new document when no document
1052
1052
matches the filter (default: `false`)
1053
1053
"""
1054
- @ spec update_one ( GenServer . server ( ) , collection , BSON . document ( ) , BSON . document ( ) , Keyword . t ( ) ) ::
1054
+ @ spec update_one ( GenServer . server ( ) , collection , BSON . document ( ) , [ BSON . document ( ) ] | BSON . document ( ) , Keyword . t ( ) ) ::
1055
1055
result ( Mongo.UpdateResult . t ( ) )
1056
1056
def update_one ( topology_pid , coll , filter , update , opts \\ [ ] ) do
1057
1057
_ = modifier_docs ( update , :update )
@@ -1061,7 +1061,7 @@ defmodule Mongo do
1061
1061
@ doc """
1062
1062
Similar to `update_one/5` but unwraps the result and raises on error.
1063
1063
"""
1064
- @ spec update_one! ( GenServer . server ( ) , collection , BSON . document ( ) , BSON . document ( ) , Keyword . t ( ) ) ::
1064
+ @ spec update_one! ( GenServer . server ( ) , collection , BSON . document ( ) , [ BSON . document ( ) ] | BSON . document ( ) , Keyword . t ( ) ) ::
1065
1065
result! ( Mongo.UpdateResult . t ( ) )
1066
1066
def update_one! ( topology_pid , coll , filter , update , opts \\ [ ] ) do
1067
1067
bangify ( update_one ( topology_pid , coll , filter , update , opts ) )
@@ -1074,7 +1074,7 @@ defmodule Mongo do
1074
1074
please refer to the [MongoDB documentation](https://docs.mongodb.com/manual/reference/command/update/#dbcmd.update)
1075
1075
1076
1076
"""
1077
- @ spec update_many ( GenServer . server ( ) , collection , BSON . document ( ) , BSON . document ( ) , Keyword . t ( ) ) ::
1077
+ @ spec update_many ( GenServer . server ( ) , collection , BSON . document ( ) , [ BSON . document ( ) ] | BSON . document ( ) , Keyword . t ( ) ) ::
1078
1078
result ( Mongo.UpdateResult . t ( ) )
1079
1079
def update_many ( topology_pid , coll , filter , update , opts \\ [ ] ) do
1080
1080
_ = modifier_docs ( update , :update )
@@ -1088,7 +1088,7 @@ defmodule Mongo do
1088
1088
GenServer . server ( ) ,
1089
1089
collection ,
1090
1090
BSON . document ( ) ,
1091
- BSON . document ( ) ,
1091
+ [ BSON . document ( ) ] | BSON . document ( ) ,
1092
1092
Keyword . t ( )
1093
1093
) :: result! ( Mongo.UpdateResult . t ( ) )
1094
1094
def update_many! ( topology_pid , coll , filter , update , opts \\ [ ] ) do
0 commit comments