So I am querying a profile table that has fk relations to 'recommendations' and 'playlist'. I want to get the profile info, recommendations of a certain type, and playlist entries marked active.
However, unless there are items that that fulfill both queries, the query will return zero rows. If there are recommendations of type 'rock', but no active playlist entries then I get zero rows.
What I want returned:
[{
name: 'Joe',
email: '[email protected]',
recommendations: [{id: 1, title: 'some title', ...}, {id: 2, title: 'other title', ...}],
playlist:[]
}]
const { data, error } = await supabase
.from('profile')
.select('''
name,
email,
recommendations!inner(
id,
title,
url,
date,
type
),
playlist!inner(
id,
active,
played,
played_date
)
'''
)
.eq('playlist.active', true)
.eq('recommendations.type', 'rock')
I looked at 'or' queries, but these are for queries filtering the same table.