I have a table with structure
id(int) | attributes (json)
1 | {"a":1,"b":2}
I want to update attributes column with another json object
{"b":5, "c":8}
such that final output looks like this
id(int) | attributes (json)
1 | {"a":1,"b":7, "c":8}
I am able to get the following result using || operator
id(int) | attributes (json)
1 | {"a":1,"b":5, "c":8}
But not the desired.
Not able to find any other specific function/operation for this task.
So any documentation will be helpfull.
Thanks in advance.
sum()) over the values and the put everything together as a JSON again - if you need to do this very often you might want to consider properly normalizing your model instead of (mis)using JSON.