Upsert map in jsonb map array

A NoSQL DB is much better suited for something like this. MongoDB has support for atomic operations on embedded fields, and all sorts of atomic array operations as well.