In a query where a == operator is used on a primary key, a filter will be applied as expected - for example, the query
from(p in Person, where: p.id == ^person1.id
and is_nil(p.first_name))
|> TestRepo.all()
will correctly return an empty list, since the target record does have a value for first_name.
However, the same query will fail if an in operator is used -
from(p in Person, where: p.id in ^[person1.id]
and is_nil(p.first_name))
|> TestRepo.all()
will return the record, even though no record should be returned due to the filter condition.
In a query where a
==operator is used on a primary key, a filter will be applied as expected - for example, the querywill correctly return an empty list, since the target record does have a value for
first_name.However, the same query will fail if an
inoperator is used -will return the record, even though no record should be returned due to the filter condition.