-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.4.3
-
Component/s: Usability
-
None
-
ALL
-
I am a normal user of mongo. When I use mongoDB to perform a combination of updateOne and pull, its behavior does not meet my expectations. I am not sure if it is a bug or the result of following established rules.
The official document's description of updateOne is that it will update a single document, but in my test statement, if the selector can hit multiple records, mongo will only check whether the first record meets the requirements, and if it does not meet the requirements, it will not check the following Record whether the requirements are met.
As shown in the steps to reproduce, my question is why do the same operations on id 1 and 2 return different results?
From what I have observed, the explanation I can give is because id 1 is in the first position, and updateOne will only check this one. Is this correct?