https://supabase.com/ logo
Hi all, just picked up Supabase for a project and ...
# off-topic
e
Hi all, just picked up Supabase for a project and I have a noob question ––  I have a table
conversations
with column
participants
of type JSONB (originally JSON but I think it needs to be JSONB) where the structure is something like:
Copy code
[
  "Emily",
  "Renee",
  "Martina"
]
I'm trying to return an array of all
conversations
where
participants
includes the current user, e.g. "Emily". This is what I've tried, but I'm certain this is wrong:
Copy code
let { data, error, status } = await supabase
    .from('conversations')
    .select('id, name, participants')
    .contains('participants', ['Emily']);
Any pointers? Or should my data be structured differently? (Future state,
participants
might be more like
[ { name: 'Emily', id: 123 } ]
but for right now I'm just trying to sorta learn the basics The error I'm getting with this is "invalid input syntax for type json"