© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
5 replies
Ryann

JS inner join match single row?

I'm trying to inner join a parent which will always be a single value but it represents an array, is there an easy way to return a single value? here's the match currently, children will be fine as an array but the parent will always be singular.
    const match = `
      *, 
      children:contact_and_type!parent_id(
        id,
        type, 
        contact:child_id(id, full_name, profile_image)
      ),
      parent:contact_and_type!child_id(
        id,
        type,
        contact:parent_id(id, full_name, profile_image)
      )`
    const match = `
      *, 
      children:contact_and_type!parent_id(
        id,
        type, 
        contact:child_id(id, full_name, profile_image)
      ),
      parent:contact_and_type!child_id(
        id,
        type,
        contact:parent_id(id, full_name, profile_image)
      )`


I currently just get the first value but I don't really like this approach:
contact.parent = contact.parent[0]
contact.parent = contact.parent[0]
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase JS-RC8 Inner Join Types
SupabaseSSupabase / help-and-questions
4y ago
inner join really slow
SupabaseSSupabase / help-and-questions
4y ago
Inner Join in Dart
SupabaseSSupabase / help-and-questions
4y ago
Converting `INNER JOIN` and `GROUP BY` to JS SDK
SupabaseSSupabase / help-and-questions
4y ago