elixir-mongo / elixir-mongo/mongodb_ecto
`order_by` does not work with Ecto 3.12
- Dominant language
- Elixir
- Stars
- 378
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
Using ecto 3.12.5, attempting to sort the result of a query with the following query pipeline
```
iex(17)> TodoItem |> order_by(asc: :id) |> Repo.all
```
results in the error
```
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Mongo.Ecto.NormalizedQuery.order/2
The following arguments were given to anonymous fn/1 in Mongo.Ecto.NormalizedQuery.order/2:
# 1
%Ecto.Query.ByExpr{
expr: [asc: {{:., [], [{:&, [], [0]}, :id]}, [], []}],
file: "iex",
line: 17,
params: nil,
subqueries: []
}
(mongodb_ecto 2.0.0-rc.2) lib/mongo_ecto/normalized_query.ex:772: anonymous fn/1 in Mongo.Ecto.NormalizedQuery.order/2
```
It seems the name of the Struct was changed from `Query.QueryExpr` to `Query.ByExpr`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.