Aggregate functions are not allowed in WHERE

I'm getting an error in my query shown below when trying to filter to get only the transactions that have a single allocation related to them

  const { data, error } = await supabaseClient
    .from('transaction')
    .select('id, allocation(count)')
    .eq('allocation.count', 1);


I understand that this is not allowed for aggregate functions and that Postgres requires using the HAVING clause instead of the WHERE clause, but I don't know how to do that with the JS client. I looked through documentation, but couldn't find anything

Any help would be greatly appreciated!
Was this page helpful?