Dynamic fields in Ecto queries

To use dynamic fields you can use the field macro.

https://hexdocs.pm/ecto/Ecto.Query.API.html#field/2

thing = :points
from a in Foo, where: field(a, ^thing) > 8
18 Likes