I have a requirement to allow filtering articles by absence of tags.
E.g. I have:
articles.id
A
B
tags.id
1
2
3
4
articles_tags.article_id articles_tags.tag_id
A 1
A 2
B 2
B 4
Now, I have a list of tag ids, e.g. (3, 4). I would like a query that returns list of articles that are missing any tags from the list.
In this example, it would return both A and B because both don't have tag 3.
If I send (1) it should return only B because A has tag 1.