logemann
04/17/2022, 1:41 PMitsnotyalc
04/17/2022, 1:41 PMitsnotyalc
04/17/2022, 1:42 PMbenten
04/18/2022, 1:40 AMcasualgardener
04/18/2022, 4:47 AMbenten
04/18/2022, 4:48 AMcasualgardener
04/18/2022, 4:51 AMbenten
04/18/2022, 5:26 AMtricked
04/18/2022, 7:28 AMuser
04/18/2022, 7:35 AMevanw
04/18/2022, 12:51 PMconversations
with column participants
of type JSONB (originally JSON but I think it needs to be JSONB) where the structure is something like:
[
"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:
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"fernandolguevara
04/18/2022, 1:12 PMSTILLWATER;
04/18/2022, 2:22 PMSTILLWATER;
04/18/2022, 2:23 PMmeera_datey
04/19/2022, 1:00 AMgaryaustin
04/19/2022, 1:57 AMSteve
04/19/2022, 2:12 AMtext
field and copying and pasting the file paths to the database.FluffySmiles
04/19/2022, 3:38 AMbarry
04/19/2022, 10:26 AMbarry
04/19/2022, 10:26 AMsockenguy
04/19/2022, 12:40 PMYelloJello
04/19/2022, 3:38 PMTodd
04/19/2022, 9:26 PMTodd
04/19/2022, 9:28 PMDanMossa
04/19/2022, 10:30 PMsilentworks
04/20/2022, 1:49 AMRefrigenator
04/20/2022, 3:50 PMRefrigenator
04/20/2022, 3:52 PMRefrigenator
04/20/2022, 3:52 PMrookiedeveloper
04/20/2022, 7:44 PM