Skip to content

Commit d7cb466

Browse files
committed
chore: changed the specs to support aggregation pipeline
1 parent f621a62 commit d7cb466

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/mongo.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ defmodule Mongo do
10511051
* `:upsert` - if set to `true` creates a new document when no document
10521052
matches the filter (default: `false`)
10531053
"""
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()) ::
10551055
result(Mongo.UpdateResult.t())
10561056
def update_one(topology_pid, coll, filter, update, opts \\ []) do
10571057
_ = modifier_docs(update, :update)
@@ -1061,7 +1061,7 @@ defmodule Mongo do
10611061
@doc """
10621062
Similar to `update_one/5` but unwraps the result and raises on error.
10631063
"""
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()) ::
10651065
result!(Mongo.UpdateResult.t())
10661066
def update_one!(topology_pid, coll, filter, update, opts \\ []) do
10671067
bangify(update_one(topology_pid, coll, filter, update, opts))
@@ -1074,7 +1074,7 @@ defmodule Mongo do
10741074
please refer to the [MongoDB documentation](https://docs.mongodb.com/manual/reference/command/update/#dbcmd.update)
10751075
10761076
"""
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()) ::
10781078
result(Mongo.UpdateResult.t())
10791079
def update_many(topology_pid, coll, filter, update, opts \\ []) do
10801080
_ = modifier_docs(update, :update)
@@ -1088,7 +1088,7 @@ defmodule Mongo do
10881088
GenServer.server(),
10891089
collection,
10901090
BSON.document(),
1091-
BSON.document(),
1091+
[BSON.document()] | BSON.document(),
10921092
Keyword.t()
10931093
) :: result!(Mongo.UpdateResult.t())
10941094
def update_many!(topology_pid, coll, filter, update, opts \\ []) do

0 commit comments

Comments
 (0)