MongoDB is not ACID compliant, hence you won't be able to do two commits atomically. The closest you'll get is using two-phase commits and rolling your own transactions and roll-back, see the MongoDB docs for more information on how to do this: docs.mongodb.org/manual/tutorial/perform-two-phas…