Skip to content

Commit 1b6c4fc

Browse files
authored
Merge pull request #46 from donaldguy/mongo-typespecs
Mongo: generalize inconsistent typespecs
2 parents 4e7e8cb + ba1e4c0 commit 1b6c4fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/mongo.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ defmodule Mongo do
255255
returning the first notification after the token. This will allow users to watch collections that have been dropped and recreated
256256
or newly renamed collections without missing any notifications. (since 4.0.7)
257257
"""
258-
@spec watch_collection(GenServer.server, collection, [BSON.document], fun, Keyword.it) :: cursor
258+
@spec watch_collection(GenServer.server, collection | 1, [BSON.document], fun, Keyword.it) :: cursor
259259
def watch_collection(topology_pid, coll, pipeline, on_resume_token \\ nil, opts \\ []) do
260260

261261
stream_opts = %{
@@ -676,7 +676,7 @@ defmodule Mongo do
676676
end
677677

678678
@doc false
679-
@spec exec_command_session(pid, BSON.document, Keyword.t) :: {:ok, BSON.document | nil} | {:error, Mongo.Error.t}
679+
@spec exec_command_session(GenServer.server, BSON.document, Keyword.t) :: {:ok, BSON.document | nil} | {:error, Mongo.Error.t}
680680
def exec_command_session(session, cmd, opts) do
681681

682682
Logger.debug("Executing cmd with session: #{inspect cmd}")
@@ -691,7 +691,7 @@ defmodule Mongo do
691691
end
692692

693693
@doc false
694-
@spec exec_command(pid, BSON.document, Keyword.t) :: {:ok, BSON.document | nil} | {:error, Mongo.Error.t}
694+
@spec exec_command(GenServer.server, BSON.document, Keyword.t) :: {:ok, BSON.document | nil} | {:error, Mongo.Error.t}
695695
def exec_command(conn, cmd, opts) do
696696

697697
Logger.debug("Executing cmd: #{inspect cmd}")
@@ -715,7 +715,7 @@ defmodule Mongo do
715715
716716
{:ok, 8}
717717
"""
718-
@spec wire_version(pid) :: {:ok, integer} | {:error, Mongo.Error.t}
718+
@spec wire_version(GenServer.server) :: {:ok, integer} | {:error, Mongo.Error.t}
719719
def wire_version(topology_pid) do
720720
with {:ok, wire_version} <- Topology.wire_version(topology_pid) do
721721
{:ok, wire_version}
@@ -740,7 +740,7 @@ defmodule Mongo do
740740
read_only: false
741741
}}
742742
"""
743-
@spec limits(pid) :: {:ok, BSON.document} | {:error, Mongo.Error.t}
743+
@spec limits(GenServer.server) :: {:ok, BSON.document} | {:error, Mongo.Error.t}
744744
def limits(topology_pid) do
745745
with {:ok, limits} <- Topology.limits(topology_pid) do
746746
{:ok, limits}

0 commit comments

Comments
 (0)