Skip to content

Relation property filter with AND doesn't work #3742

Answered by ganigeorgiev
tobycm asked this question in Q&A
Discussion options

You must be logged in to vote

Something similar was reported previously but I'm not sure how to explain it better.

In short it works correctly because internally when you filter by relation fields we perform a JOIN with the related collection(s) and colors.name will refer to a single record of that join, aka. colors.name cannot be 2 different things at the same time.
Internally the above filter will produce a pseudo-query like:

SELECT example.*
FROM example
LEFT JOIN colors ON ...
WHERE colors.name = "white" AND colors.name = "black"

We currently don't support IN like operation on nested multiple relation fields, if that's what you are looking for (I've added a note in the roadmap to consider it together with some oth…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tobycm
Comment options

Answer selected by tobycm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants