You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
works, when trying to set the sort direction like this
dynamic([q], desc: field(q, :id))
results in the following error:
** (Ecto.Query.CompileError) Tuples can only be used in comparisons with literal tuples of the same size
I've asked this question on the Elixir forum and have a working solution, but it would seem that either the docs are inaccurate, or the feature mentioned isn't working as expected
The text was updated successfully, but these errors were encountered:
Environment
Elixir version (elixir -v):
Elixir 1.10.2 (compiled with Erlang/OTP 21)
Database and version (PostgreSQL 9.4, MongoDB 3.2, etc.):
PostgreSQL 12.2
Ecto version (mix deps):
3.3.4
Database adapter and version (mix deps):
ecto_sql 3.3.4
Operating system:
KDE Neon
The documentation at https://hexdocs.pm/ecto/dynamic-queries.html#building-dynamic-queries shows how to use dynamics for ordering results. I have tried this and while
dynamic([q], field(q, :id))
works, when trying to set the sort direction like this
dynamic([q], desc: field(q, :id))
results in the following error:
I've asked this question on the Elixir forum and have a working solution, but it would seem that either the docs are inaccurate, or the feature mentioned isn't working as expected
The text was updated successfully, but these errors were encountered: