For Collection Datatypes map/list/set, +
and -
operator is used to append or remove the <key, value> entries from the collection. Also, we cannot use counter datatype in collections, every time you try to update counter will just be re-initialized.
UPDATE counter_test SET mapcounter['c1'] = + 1 WHERE id = 'a1';
id | mapcounter ----+------------ a1 | {'c1': 1}
UPDATE counter_test SET mapcounter['c1'] = + 2 WHERE id = 'a1';
id | mapcounter ----+------------ a1 | {'c1': 2}
You will need to handle the counter increment on the application side.
Please refer to docs here -