I know MongoDB doesn\'t support transactions as relational databases do, but I still wonder how to achieve atomicity for several operations. Hunting around the web, I see people
Transactions are not supported in MongoDB out of the box. However they are implementable with Two-phase commit protocol. Here you can see official recommendation on how to do 2PCs in MongoDB. This approach is quite universal and can be applied to different scenarios such as