© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
4 replies
inorganik

supabase-js query with nested date compare

I'm trying to use a filter inside a join query for products but am getting errors. Here is the query:
const { data, error } = await locals.supabase
    .from('trucks')
    .select('id, products(*, arrival_time.gte.now()), routes(*).order(order)')
    .eq('id', params.truckId)
    .single()
const { data, error } = await locals.supabase
    .from('trucks')
    .select('id, products(*, arrival_time.gte.now()), routes(*).order(order)')
    .eq('id', params.truckId)
    .single()

which give me the error
unexpected '.'
unexpected '.'


so I asked the supabase AI and it gave me another way:
'id, products(* , arrival_time >= now()), routes(*).order(order)'
'id, products(* , arrival_time >= now()), routes(*).order(order)'

which also gave me an error
unexpected '>'
unexpected '>'


Is there a way to do this type of query with the supabase-js client? Looks like I'm on
^2.45.0
^2.45.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 query question
SupabaseSSupabase / help-and-questions
13mo ago
Update date field with supabase's instance date
SupabaseSSupabase / help-and-questions
4mo ago
Redux-Query(RTK-query) with supabase
SupabaseSSupabase / help-and-questions
4y ago
Supabase query
SupabaseSSupabase / help-and-questions
4y ago