I ran the following scenario:
First, inserted documents:
for (var i = 0; i <100; i++) {db.col1.insert({_id: i, "new5" :22})}
Then updated them with the following command:
db.col1.updateMany({}, {$set: { "new5": 900, "new6" : 600 } })
The server was killed while the updateMany command was running and after it was up again I checked the status of the collection.
I saw that some of documents were with the updated value "new5" : 900, "new6" : 600 and other remained with the original value although I expected a rollback will be applied and all the documents
will be retrieved to the old value. Am I missing something? is there a special mode which guarantees the atomicty of the entire update operation? Thanks!