- Adding new rows
INSERT INTO USER (DEPARTMENTS)
VALUES ('["dept1","dept2"]')
- Adding an new value to the column
UPDATE USER
SET DEPARTMENTS = DEPARTMENTS || '["dept3"]'::JSONB
- Removing an value from the column
UPDATE USER
SET DEPARTMENTS = DEPARTMENTS - '["dept1"]'::JSONB
Top comments (0)