Hi,
Apologise for earlier post of in process codebase and case scenarios this is my updated codebase;
ui = [%{"age" => 19}, %{"fullname" => "todd"}]
lists=ui
|> Enum.map(&Enum.to_list/1)
|> Enum.reduce(User, fn [{key, value}], query ->
field = String.to_existing_atom(key)
search = "%#{value}%"
Repo.all from(q in query, where: like(field(q, ^field), ^search), select: {q.fullname, q.age})
end)
IO.inspect lists
However , I am getting below exception for the same . could you please provide any pointers on same
** (exit) an exception was raised:
** (Protocol.UndefinedError) protocol Ecto.Queryable not implemented for [{"
Todd", 19}]
(ecto) lib/ecto/queryable.ex:1: Ecto.Queryable.impl_for!/1
(ecto) lib/ecto/queryable.ex:9: Ecto.Queryable.to_query/1






















