elixir - Querying by DateTime in Ecto -
here have tried.
date = ecto.datetime.from_erl(:calendar.universal_time()) query |> where([record], record.deadline >= ^date)
i tried
date = ecto.datetime.from_erl(:calendar.universal_time()) query = m in myapp.somemodel, where: m.deadline >= ^date, select: m
both return same message
value `%ecto.datetime{..}` in `where` cannot cast type :datetime in query
from understand supposed using ecto.datetime in queries. maybe missing obvious? thanks!
the :datetime
type native type , works tuples. if set column type ecto.datetime
in schema, able work higher level types ecto.datetime struct.
Comments
Post a Comment