I am experiencing really weird behavior when trying to update a single record. I use UpdateOne() method and it works as expected in 99% of cases BUT sometimes I get the following results:
As you can see, MongoDB was able to find my record but it wasn't updated. I've tried to change write concern, which accordingly to the docs, might help:
collection.WithWriteConcern(WriteConcern.WMajority.With(journal: true))
but it didn't.
Here is how I update my records:
collection.UpdateOne(x => x.Id == _myObject.Id.AsObjectId, updateDef);
Update definition:
var updateDef = new UpdateDefinitionBuilder<IndexedProfileData>().Set(x => x.Property.ChildCollection, newCollection);
I would be really appreciated if somebody could explain me why this is happening and how to fix this behavior.