diff --git a/CHANGELOG.md b/CHANGELOG.md index c647b69..4936c22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.1.2 +* Add support for loading nil dates + +## 1.1.1 +* Allow `binary_id` fields to be nil + +## 1.1.0 +* Add support for Ecto 1.11 + ## 1.0.0 * Introduce support for Ecto 3 diff --git a/lib/mongo_ecto.ex b/lib/mongo_ecto.ex index 3c03260..1593d14 100644 --- a/lib/mongo_ecto.ex +++ b/lib/mongo_ecto.ex @@ -453,6 +453,10 @@ defmodule Mongo.Ecto do defp load_time(time), do: time + defp load_date(nil) do + {:ok, nil} + end + defp load_date(date) do {:ok, date |> DateTime.to_date()} end @@ -475,6 +479,8 @@ defmodule Mongo.Ecto do :error end + defp load_objectid(nil), do: {:ok, nil} + defp load_objectid(_arg), do: :error @impl true @@ -573,6 +579,7 @@ defmodule Mongo.Ecto do ArgumentError -> :error end + defp dump_objectid(nil), do: {:ok, nil} defp dump_objectid(_), do: :error @impl Ecto.Adapter.Schema diff --git a/mix.exs b/mix.exs index 5592605..8f2915f 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Mongo.Ecto.Mixfile do use Mix.Project @source_url "https://github.com/elixir-mongo/mongodb_ecto" - @version "1.1.0" + @version "1.1.2" def project do [