Today I am trying to update the multiple values of jsonb array on the basis of id key.
I have column uniqueid and jsarray in table "people".
E.g. select * from people
1, [{"id": 1101, "val": "testing1", "valuom": "", "description": "Desc_test_1"},
{"id": 1105, "val": "testing2", "valuom": "", "description": "Desc_test_2"},
{"i d": 1108, "val": "testing2", "valuom": "", "description": "Desc_test_3"}]
I need to update the values of Description, val and valuom on the basis of id key.
for e.g update the jsarray column where id= 1101 and uniqueid=1; need o/p as:
1 , [{"id":1101,"val":"testing5","valuom":"test5", "description":"Desc_test_5"},
{"id":1105,"val":"testing2","valuom":"","description":"Desc_test_2"} ,
{"id":1108,"val":"testing2","valuom":"","description":"Desc_test_3"}];