supabasesupabase-js

How to filter on text array column with supabase-js


I have a table i Supabase which looks like this: enter image description here

I want to use supabase-js client library to filter on phone_numbers (which is a text array).
If I do like this:

const { data, error } = await supabaseClient.from('profiles').select('*').contains('phone_numbers', ["123456"])

I get no result back.

If I do this in raw SQL it works (I get the row with id 2 back):

select * from profiles where phone_numbers @> array['123456'];

What am I doing wrong in the javascript filter?


Solution

  • Never mind, it was a RLS policy issue.