SupabaseS
Supabase4y ago
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


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)


but it's either: returning nothing or returning more than expected.
Am I missing anything?
Was this page helpful?