Is in Mongo any way to do check and setting like atomic operation ? I am making booking for hotels and if there is free room you can reserve, but what if two or more people want to reserve in same time. Is there anything similar to transaction in Mongo or any way to solve this problem ?
Share
Yes, that’s the classic use case for MongoDB’s
findAndModifycommand.Specifically for pymongo:
find_and_modify.