I have the following json in my column in posgres database.
Column items in table products
{
"name": "Super name",
"type": "Green",
"information": [
{
"name": "first",
"value": "high"
},
{
"name": "second",
"value": "medium"
}
],
}
I want to delete json object using jsonb
{
"name": "second",
"value": "medium"
}
I try this:
update products set items = jsonb_set(items, '{information}', (items->'information') - '{"name": "second", "value": "medium"}');
I tried different approaches but nothing work correctly.