Comment by tgv

13 hours ago

And can you explain why? I think not. What's the superior alternative, for every use case?

https://www.manning.com/books/just-use-postgres

  • PG JSON write operations are document level whereas with Mongodb it's field level.

    Would you use a DB that only let you write an entire row instead of setting a single field? Race conditions galore. Be very careful choosing PG for JSON in production systems...

    • 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