Hi, I need some help in updating an jsonb[ ], this...
# sql
m
Hi, I need some help in updating an jsonb[], this is how my schema looks like, { "id":"8a015caf-aa3b-4044-9f88-9f64fbcdbf8e", "question":"Test question 2", "options":[ { "id":"cf38e648-fbd8-4b20-9fb7-bdd0476d71e5", "text":"option1", "votes":0}, { "id":"c23ef382-3a27-4a15-bca0-ab156bdaad24", "text":"option2", "votes":0 } ], "total_votes":0 }
t
I'm quite new to supabase so this answer might not be the best way. Though I have a idea that you could use sql directly using
jsonb_set
as described in: https://www.postgresql.org/docs/14/functions-json.html You could wrap this in a
rpc
and call that with supabase.
m
hmmm, i'll look into that, thanks !