https://supabase.com/ logo
#help
Title
# help
s

stnmonroe

04/07/2022, 3:49 PM
How can one get the count of a relationship? For example...
Copy code
...from('notes').select('
 *,
 tasks({ count: 'exact', head: true })
'),
n

Needle

04/07/2022, 3:49 PM
Hello @stnmonroe! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
s

Steve

04/07/2022, 3:52 PM
@stnmonroe You can do it like:
n

Needle

04/07/2022, 3:52 PM
stnmonroe (2022-04-07)
s

Steve

04/07/2022, 3:52 PM
Copy code
js
...from('notes').select('
 *,
 tasks(count)
'),
s

stnmonroe

04/07/2022, 3:52 PM
Thank you sooooo much!