K
K
komarevtsev2016-03-16 11:29:16
MongoDB
komarevtsev, 2016-03-16 11:29:16

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

2 answer(s)
S
s0ci0pat, 2016-03-16
@s0ci0pat

Just don't use mongodb for this. mongo is written to store non-valuable data

I
Ivan, 2016-03-16
@0neS

How to get around the lack of transactions in MongoDB?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question