having some troubles with POSTGRES queries.
I have a column jsonb called venue_menu which has an array of objects that looks like this:
[
{ "menu_id":"0", "menu_name":"name 1"},
{ "menu_id":"1", "menu_name":"name 2"},
{ "menu_id":"2", "menu_name":"name 3"}
]
I want to make an update, for instance at the object where menu_id is 2 for a particular row which is selected by the column client_id (the WHERE clause). I have the following query so far
UPDATE client SET venue_menu = jsonb_set(venue_menu, '{}', { "menu_id":"2", "menu_name":"name updated"}) WHERE client_id = "1";
I can't seem to figure out where to do the query that specifies the key name of the object I want to update, any ideas?
Thank you.