Remove key/value from jsonb data structure
If you store jsonb in your postgres database, you will find yourself manipulating json data periodically in postgres.
Removing a key/value from a jsonb object is very simple, just use the subtraction operator.
> select '{"a": 1, "b": 2}'::jsonb - 'a';
?column?
----------
{"b": 2}
(1 row)
Tweet