MongoCollection.replaceOne
UpdateResult replaceOne(T, U)(T filter, U replacement, ReplaceOptions options) @safeReplaces at most single document within the collection based on the filter.
It's recommended to use the ReplaceOptions overload, but UpdateOptions can be used as well. Note that the extra options inside UpdateOptions may have no effect, possible warnings for this may only be handled by MongoDB.
See Also
Standards
UpdateResult replaceOne(T, U)(T filter, U replacement, UpdateOptions options = UpdateOptions.init) @safeditto