Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joeapearson committed Mar 4, 2021
1 parent 0e14878 commit 294b5e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/mongo/grid_fs/bucket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ defmodule Mongo.GridFs.Bucket do
Mongo.find(topology_pid, files_collection_name(bucket), filter, opts)
end


@doc """
Finds one file document with the file_id as a string
Finds one file document by `file_id` specified either as a string or `BSON.ObjectId`.
"""
def find_one(bucket, file_id)

@spec find_one(Bucket.t, String.t) :: BSON.document | nil
def find_one(%Bucket{} = bucket, file_id) when is_binary(file_id) do
find_one(bucket, ObjectId.decode!(file_id))
end

@doc """
Finds one file document with the file_id as an ObjectID-struct
"""
@spec find_one(Bucket.t, BSON.ObjectId.t) :: BSON.document | nil
def find_one(%Bucket{topology_pid: topology_pid, opts: opts} = bucket, %BSON.ObjectId{} = oid) do
Mongo.find_one(topology_pid, files_collection_name(bucket), %{"_id" => oid}, opts)
Expand Down
9 changes: 6 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ defmodule Mongodb.Mixfile do
defp elixirc_paths(_), do: ["lib"]

def application() do
[applications: applications(Mix.env),
mod: {Mongo.App, []},
env: []]
[
applications: applications(Mix.env),
env: [],
extra_applications: [:crypto, :ssl],
mod: {Mongo.App, []}
]
end

def applications(:test), do: [:logger, :connection, :db_connection]
Expand Down

0 comments on commit 294b5e4

Please sign in to comment.