Ecto.Query.where
You're seeing just the macro
where
, go back to Ecto.Query module for more information.
An AND where query expression.
where
expressions are used to filter the result set. If there is more
than one where expression, they are combined with an and
operator. All
where expressions have to evaluate to a boolean value.
where
also accepts a keyword list where the field given as key is going to
be compared with the given value. The fields will always refer to the source
given in from
.
Keywords example
from(c in City, where: c.country == "Sweden")
from(c in City, where: [country: "Sweden"])
It is also possible to interpolate the whole keyword list, allowing you to dynamically filter the source:
filters = [country: "Sweden"]
from(c in City, where: ^filters)
Expressions examples
City |> where([c], c.country == "Sweden")
City |> where(country: "Sweden")