How do interpolation fields in Ecto queries?
问题 The Ecto documentation shows how to do interpolation values. But I need dynamic fields in my queries. I have dozens of fields and write queries for each of them does not seem cohesive. defmodule Hedone.SearchController do use Hedone.Web, :controller alias Hedone.User def idade(conn, %{"idade+" => maior, "idade-" => menor, "campo" => campo}) do IO.inspect campo query = from u in User, where: u.campo > ^maior and u.campo < ^menor, select: u.name pesquisa = Repo.all query IO.inspect pesquisa