I have a table with the jsonb field, an example of value:
{
"id": "test",
"data": [
{
"folder1": ["id1", "id2", "id3"]
}
]
}
I want to replace array ["id1", "id2", "id3"] inside this the data to [{"id": "id1", "size": 10}, {"id": "id2", "size": 100}, {"id": "id3", "size": 1000}]:
{
"id": "test",
"data": [
{
"folder1": [
{"id": "id1", "size": 10},
{"id": "id2", "size": 100},
{"id": "id3", "size": 1000}
]
}
]
}
If it possible to update it in the single sql construction ot I need to do it with pl/sql?