Closed kingsanu closed 11 months ago
this is how you do a findAndModify
in mongodb-entities.
here's how mongodb server handles concurrency, and the atomicity of findAndModify.
Dear sir, I understand that you have an option called UpdateAndGet. My inquiry is whether this option internally locks the row when another person is updating the same row. If it does, does another request wait until the first update is complete, or does it simply fail (the second request)?
the library does nothing special regarding locking and ultimately delegates the call out to the mongo driver's FindOneAndUpdateAsync()
method:
here's the definitive answer to how mongo handles concurrency for write operations.
I've 3 billing machin and they want latest stock from central database and that database habe only one row/document shared to 3 billing machine, so i want to ask does Db.Update() lock the row? if not than what can be other option, i seen findAndModify can help i think so how can i use then ?