Skip to content

Commit

Permalink
Merge pull request #84 from joeapearson/master
Browse files Browse the repository at this point in the history
Thank you!
  • Loading branch information
zookzook authored Mar 5, 2021
2 parents 0e14878 + daa4b23 commit 6b3be9d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/mongo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1193,12 +1193,14 @@ defmodule Mongo do
end

@doc """
Convenient function to creates new indexes in the collection `coll`. The `indexes` parameter
is a keyword list with all options for creating indexes in the MongoDB.
See [options](https://docs.mongodb.com/manual/reference/command/createIndexes/#dbcmd.createIndexes) about the
details of each parameter.
Convenient function to creates new indexes in the collection `coll`. The `indexes` parameter is a
list with all options for creating indexes in the MongoDB.
See
[options](https://docs.mongodb.com/manual/reference/command/createIndexes/#dbcmd.createIndexes)
about the details of each parameter.
"""
@spec create_indexes(GenServer.server, String.t, Keyword.t, Keyword.t) :: :ok | {:error, Mongo.Error.t}
@spec create_indexes(GenServer.server, String.t, [Keyword.t], Keyword.t) :: :ok | {:error, Mongo.Error.t}
def create_indexes(topology_pid, coll, indexes, opts \\ []) do
cmd = [createIndexes: coll, indexes: indexes]
with {:ok, _} <- Mongo.issue_command(topology_pid, cmd, :write, opts) do
Expand Down

0 comments on commit 6b3be9d

Please sign in to comment.