I understand that with other operations such as insertMany there’s an option for
ordered meaning that the inserts are performed in the order specified but its unclear how the update processes behaves. Especially in the event that more than one update to the same document is part of the list of updates.
Is it possible that one update wins over the other every time? Or would it be seemingly random?
We’re running into an issue where we have multiple updates being applied to documents, with a fix soon coming to address that. I was just unsure how Mongo itself would handle those updates assuming one or more documents are being updated multiple times during the updateMany command.
What I would assume would be the case is that one update might be processed before the other (assuming they aren’t ordered) and then the update that modifies the document LAST is the state of the document going forward. Essentially “overwriting” the update from before (we aren’t doing $addToSet or anything - just property values) so a change to property x to value y might be changed to value z.
Am I on the right track here?