jJ
06/23/2022, 2:06 PMsql
SELECT *
FROM public.articles AS articles
WHERE EXISTS(
SELECT FROM public.articles_filters
WHERE public.articles.id = article_id AND filter_id = 'bfc8c9ca-361c-51d5-be59-e2ce0aa7e6a6'
)
if I use
javascript
.select(`*, articles_filters!inner(*)`)
.eq('articles_filters.filter_id', 'bfc8c9ca-361c-51d5-be59-e2ce0aa7e6a6')
and because of the inner join it only returns the articles with the one articles_filters, while I would like to return with all of them as you do with .select(*, articles_filters(*)) but with the ability to filter
I tried .filter(), but it seems that I still need to use !inner
Kind regards, Joegaryaustin
06/23/2022, 2:26 PM.select(`* my_filters:articles_filters!inner(*), articles_filters(*)`)
.eq('my_filters.filter_id', 'id')jJ
06/23/2022, 2:28 PMjJ
06/23/2022, 2:39 PM