Skip to content

Commit 6b03686

Browse files
committed
Convert collection name to binary in case of none binary type
1 parent dc404c7 commit 6b03686

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/mongo.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,13 @@ defmodule Mongo do
15481548

15491549
{_, params} = Keyword.pop_first(cmd, command)
15501550
collection = Keyword.get(cmd, command)
1551+
1552+
collection =
1553+
case is_binary(collection) do
1554+
true -> collection
1555+
false -> collection |> to_iodata() |> IO.iodata_to_binary()
1556+
end
1557+
15511558
do_log(command, collection, params, duration, opts)
15521559
end
15531560
end

0 commit comments

Comments
 (0)