Skip to content

Commit

Permalink
chore: changed the specs to support aggregation pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
zookzook committed Jul 30, 2023
1 parent f621a62 commit d7cb466
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mongo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ defmodule Mongo do
* `:upsert` - if set to `true` creates a new document when no document
matches the filter (default: `false`)
"""
@spec update_one(GenServer.server(), collection, BSON.document(), BSON.document(), Keyword.t()) ::
@spec update_one(GenServer.server(), collection, BSON.document(), [BSON.document()] | BSON.document(), Keyword.t()) ::
result(Mongo.UpdateResult.t())
def update_one(topology_pid, coll, filter, update, opts \\ []) do
_ = modifier_docs(update, :update)
Expand All @@ -1061,7 +1061,7 @@ defmodule Mongo do
@doc """
Similar to `update_one/5` but unwraps the result and raises on error.
"""
@spec update_one!(GenServer.server(), collection, BSON.document(), BSON.document(), Keyword.t()) ::
@spec update_one!(GenServer.server(), collection, BSON.document(), [BSON.document()] | BSON.document(), Keyword.t()) ::
result!(Mongo.UpdateResult.t())
def update_one!(topology_pid, coll, filter, update, opts \\ []) do
bangify(update_one(topology_pid, coll, filter, update, opts))
Expand All @@ -1074,7 +1074,7 @@ defmodule Mongo do
please refer to the [MongoDB documentation](https://docs.mongodb.com/manual/reference/command/update/#dbcmd.update)
"""
@spec update_many(GenServer.server(), collection, BSON.document(), BSON.document(), Keyword.t()) ::
@spec update_many(GenServer.server(), collection, BSON.document(), [BSON.document()] | BSON.document(), Keyword.t()) ::
result(Mongo.UpdateResult.t())
def update_many(topology_pid, coll, filter, update, opts \\ []) do
_ = modifier_docs(update, :update)
Expand All @@ -1088,7 +1088,7 @@ defmodule Mongo do
GenServer.server(),
collection,
BSON.document(),
BSON.document(),
[BSON.document()] | BSON.document(),
Keyword.t()
) :: result!(Mongo.UpdateResult.t())
def update_many!(topology_pid, coll, filter, update, opts \\ []) do
Expand Down

0 comments on commit d7cb466

Please sign in to comment.