© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
jdgamble555

Nested ordering not working in V2

So it seems like I should be able to order by nested values on the supabase js sdk according to this:

https://github.com/supabase/supabase/discussions/229

q = this.sb.supabase.from('tags')
  .select('*, pid!inner(*, author!inner(*))', { count: 'exact' })
  .eq('name', tag)
  .order('pid.created_at', { ascending: true })
  .range(from, to)
q = this.sb.supabase.from('tags')
  .select('*, pid!inner(*, author!inner(*))', { count: 'exact' })
  .eq('name', tag)
  .order('pid.created_at', { ascending: true })
  .range(from, to)


tags
- pid (fk to posts.id)
- ...

posts
- created_at
- ...

I'm trying to sort by the posts created at field. I get a 400 error. However, when I comment out the
.order()
.order()
line, everything works fine.


J
GitHub
Order parent and children? · Discussion #229 · supabase/supabase
In an order expression is there a way to order the parent objects and the nested/foreign/child objects? Like this: supabase.from("parents").select(", children()&quo...
Order parent and children? · Discussion #229 · supabase/supabase
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

Ordering with timestamp not working ;(
SupabaseSSupabase / help-and-questions
4y ago
realtime with v2 not working
SupabaseSSupabase / help-and-questions
4y ago
v2 Realtime not working as expected.
SupabaseSSupabase / help-and-questions
4y ago
Auth v2 not working with jsdelivr or unpkg
SupabaseSSupabase / help-and-questions
4y ago