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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -