The UpdateOne and UpdateMany methods do not ensure that the update parameter has at least one modifier. Update the ensureDollarKey method to return an error if there are no modifiers provided.
(original description below)
mongo.UpdateOne() erases all fields from a document matched by a filter when update interface is bson.D{} with zero length. That behavior is unwanted in my opinion (i've lost some data). Mongo shell acts differently (just returns an error 'the update operation document must contain at least one atomic operator'). I didn't check Update() and UpdateMany() but these ones may act the same as UpdateOne().