fetching count as an object instead of array

hey there. currently fetching counts of rows across multiple tables and it's kinda weird to get the count of rows as an array. is there a way to get the count as a single item?
i know aggregate functions exist and i tried using them but even looking at the docs for count it looks weird
https://docs.postgrest.org/en/latest/references/api/aggregate_functions.html
      const { data: topic } = await supabase
        .from("topic")
        .select(`
                id,
          parent_topic_id,
          subject_id,
          question_count:topic_question(count()).count(),
          video_count:topic_video(count()),
          note_count:topic_note(count()),
          flashcard_count:topic_flashcard_deck(count()),
          lesson_count:topic_lesson(count())
        `, {count: "exact"})
Was this page helpful?