Nested Where Clause in Many-to-Many relation using Query
Hello, I have a many-to-many relationship between my events categories table.' As of now, I am trying to filter this data by joining my events table with the junction table (eventToCategories) and then the junction table with categories table. When attempting to use the where clause in the categories table so I could filter by certain events, typescript told me that the where clause was not allowed to be used here. I am not fully sure why this is the case, but I was wondering if anyone had a solution to this? I will attach my query as well as schema things in this. Thank you.
![No description](https://cdn.answeroverflow.com/1245951441097592935/Screenshot_2024-05-30_at_03.43.53.png)
![No description](https://cdn.answeroverflow.com/1245951441449783296/Screenshot_2024-05-30_at_04.01.50.png)
![No description](https://cdn.answeroverflow.com/1245951441760292955/Screenshot_2024-05-30_at_04.02.24.png)
![No description](https://cdn.answeroverflow.com/1245951442011820032/Screenshot_2024-05-30_at_04.03.28.png)
4 Replies
what is the underline hover message?
can you move the where clause to below the includes true
This is the issue the hover message and shows the same result whether I move it below the the includes
![No description](https://cdn.answeroverflow.com/1245985077754728532/Screenshot_2024-05-31_at_01.19.18.png)
I also tried to add the where clause where I would ideally like it (this is in order to determine if an event's categories are in the selected array of categories determined by the user). Interestingly enough, this removes the underline error I was having before
![No description](https://cdn.answeroverflow.com/1245986550597292103/Screenshot_2024-05-31_at_01.21.36.png)
Basically my issue here is that I need a way to filter this category table, but I am not able to get access the where clause so I cannot filter