Ecto.Query.API.any
You're seeing just the function
any
, go back to Ecto.Query.API module for more information.
Tests whether one or more values returned from the provided subquery match in a comparison operation.
from p in Product, where: p.id = any(
from(li in LineItem, select: [li.product_id], where: li.created_at > ^since and li.qty >= 10)
)
A product matches in the above example if a line item was created since the provided date where the customer purchased at least 10 units.
Both any
and all
must be given a subquery as an argument, and they must be used on the right hand side of a comparison.
Both can be used with every comparison operator: ==
, !=
, >
, >=
, <
, <=
.