Answer the question
In order to leave comments, you need to log in
Lots of requests to mongo?
I have a node js project. When buying from a person, the balance is removed after checking certain conditions of the purchase. If you make requests very quickly, then you can, having a product for 100 rubles and on a balance of 100 rubles, buy it 2 times, for example, and drive the balance into a minus. how to deal with it? I read about the atomicity of operations in mongo, but I didn’t understand it well
Answer the question
In order to leave comments, you need to log in
Just don't use mongodb for this. mongo is written to store non-valuable data
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question