From 99685906ae2847d0c8d6311a4098f04e655a0d8a Mon Sep 17 00:00:00 2001 From: Asger Hautop Drewsen Date: Fri, 6 Sep 2024 11:26:57 +0200 Subject: [PATCH] Update Updates.set to allow Bson value argument --- .../src/main/com/mongodb/client/model/Updates.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/driver-core/src/main/com/mongodb/client/model/Updates.java b/driver-core/src/main/com/mongodb/client/model/Updates.java index 82595cc79c8..64b403cb6d9 100644 --- a/driver-core/src/main/com/mongodb/client/model/Updates.java +++ b/driver-core/src/main/com/mongodb/client/model/Updates.java @@ -66,6 +66,17 @@ public static Bson combine(final List updates) { return new CompositeUpdate(updates); } + /** + * Creates an update that sets the values for the document. + * + * @param value the value + * @return the update + * @mongodb.driver.manual reference/operator/update/set/ $set + */ + public static Bson set(final Bson value) { + return new SimpleBsonKeyValue("$set", value); + } + /** * Creates an update that sets the value of the field with the given name to the given value. *