How to update deeply nested JSON object based on filter criteria in Postgres?
问题 I have a table mapping_transform with a JSONB column content_json containing something like { "meta": {...}, "mapping": [ ..., { "src": "up", "dest": "down", ... }, ... ] } I want to add a new JSON entry ( "rule_names": [ "some name" ] ) to the JSON object matching src = up and dest = down , which would result in { "meta": {...}, "mapping": [ ..., { "src": "up", "dest": "down", ..., "rule_names": [ "some name" ] }, ... ] } The following query returns the JSON object that meets the filter