© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
Zed

filtering key from a jsonb column that is not null

Hi, I'm trying to query from a jsonb column. I had this working at the query editor but I can't seem to convert it to the javascript equivalent.

select first_name, last_name, schedule as "Thursday" from "Employees"  where schedule#>'{4}' is not null
select first_name, last_name, schedule as "Thursday" from "Employees"  where schedule#>'{4}' is not null


Sample Record:
First_Name | Last_Name | Schedule
John | Doe | {"4":[8,9]}

I've tried:
supabaseClient.from('Employees')         .select('first_name,last_name,schedule')
            .not('schedule#>{4}', 'is', null)
supabaseClient.from('Employees')         .select('first_name,last_name,schedule')
            .not('schedule#>{4}', 'is', null)


supabaseClient.from('Employees')    .select('first_name,last_name,schedule')
            .not('schedule->>4', 'is', null)
supabaseClient.from('Employees')    .select('first_name,last_name,schedule')
            .not('schedule->>4', 'is', null)


but it's either: returning nothing or returning more than expected.
Am I missing anything?
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

Only insert nullable column if not null
SupabaseSSupabase / help-and-questions
4y ago
how to query & filter depending on if a key exists in a jsonb column?
SupabaseSSupabase / help-and-questions
3y ago
Query for non-null values in a nullable column
SupabaseSSupabase / help-and-questions
3y ago
Using contains query for a nested jsonb column
SupabaseSSupabase / help-and-questions
4y ago