Is find on update atomic?


update = filter+update (i mean the normal update not findOneAndUpdate)

if filter is succeful document is locked until it is updated?
the same happen in UpdateMany?
For example i found 10, 10 locks, and each lock is released when each document is done?
(no need to wait for 10 to be update and release all lock, each lock free after each doc is updated)

Any link/tutorial/book about concurency of MongoDB will help alot, i tried the FAQ concurency, but i think i have so many understanding gaps.

Thank you

Hi @Takis ,

Any findAndUpdateOne is atomic as long as it hit a single document.


1 Like

Thank you for your reply,i changed the question, i meant filter of update command not the findOneAndUpdate.
It makes senses to be locked until update, i just wasnt sure.