Skip to content

Commit

Permalink
Fix: Allow binary_id fields to be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmessinger committed Dec 16, 2023
1 parent 80e2f4b commit 9eaf5f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mongo_ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ defmodule Mongo.Ecto do
:error
end

defp load_objectid(nil), do: {:ok, nil}

defp load_objectid(_arg), do: :error

@impl true
Expand Down Expand Up @@ -589,6 +591,7 @@ defmodule Mongo.Ecto do
ArgumentError -> :error
end

defp dump_objectid(nil), do: {:ok, nil}
defp dump_objectid(_), do: :error

@impl Ecto.Adapter.Schema
Expand Down

0 comments on commit 9eaf5f6

Please sign in to comment.