top | item 46434844

(no title)

rafaelgoncalves | 2 months ago

on postgres I can update a field easily and atomically with transactions (or there is something I don't know about?), like (postgresql 14)[0]:

   UPDATE users SET profile = profile || '{"lastname":"Washington"}' WHERE profile->>'name' = 'George Washington';
[0] https://stackoverflow.com/a/38045827

discuss

order

winrid|2 months ago

Nope. If two writes happen concurrently on different fields you'll lose one write, unless you lock. The storage layer just stores the data as a blob that gets overwritten every time, it doesn't support partial updates.

empthought|2 months ago

Of course it supports partial updates. It just requires you to know the difference between a document and a field, and model your data appropriately.