+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an
* optional fields specification. Must not be {@literal null}.
@@ -961,6 +964,9 @@ default
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an
* optional fields specification. Must not be {@literal null}.
@@ -979,6 +985,9 @@ default
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an
* optional fields specification.
@@ -999,6 +1008,9 @@ default
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an
* optional fields specification. Must not be {@literal null}.
@@ -1391,8 +1403,11 @@ default long exactCount(Query query, String collectionName) {
* leverages Type Conversion API. See
* Spring's
* Type Conversion" for more details.
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1408,7 +1423,9 @@ default long exactCount(Query query, String collectionName) {
* The object is converted to the MongoDB native representation using an instance of {@see MongoConverter}. Unless
* configured otherwise, an instance of {@link MappingMongoConverter} will be used.
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1420,6 +1437,11 @@ default long exactCount(Query query, String collectionName) {
/**
* Insert a Collection of objects into a collection in a single batch write to the database.
+ *
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param batchToSave the batch of objects to save. Must not be {@literal null}.
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
@@ -1431,6 +1453,11 @@ default long exactCount(Query query, String collectionName) {
/**
* Insert a batch of objects into the specified collection in a single batch write to the database.
+ *
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param batchToSave the list of objects to save. Must not be {@literal null}.
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
@@ -1441,6 +1468,11 @@ default long exactCount(Query query, String collectionName) {
/**
* Insert a mixed Collection of objects into a database collection determining the collection name to use based on the
* class.
+ *
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param objectsToSave the list of objects to save. Must not be {@literal null}.
* @return the inserted objects.
@@ -1458,7 +1490,11 @@ default long exactCount(Query query, String collectionName) {
* String then MongoDB ObjectId will be used to populate that string. Otherwise, the conversion from ObjectId to your
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See
* Spring's
- * Type Conversion" for more details.
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1466,6 +1502,8 @@ default long exactCount(Query query, String collectionName) {
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
* @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
* {@link #getCollectionName(Class) derived} from the given object type.
+ * @throws org.springframework.dao.OptimisticLockingFailureException in case of version mismatch in case a
+ * {@link org.springframework.data.annotation.Version} is defined.
*/
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
* @return the saved object.
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
+ * @throws org.springframework.dao.OptimisticLockingFailureException in case of version mismatch in case a
+ * {@link org.springframework.data.annotation.Version} is defined.
*/
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
+ *
* NOTE: {@link Query#getSortObject() sorting} is not supported by {@code db.collection.updateOne}.
* Use {@link #findAndModify(Query, UpdateDefinition, FindAndModifyOptions, Class, String)} instead.
*
@@ -1532,6 +1580,9 @@ default long exactCount(Query query, String collectionName) {
/**
* Performs an upsert. If no document is found that matches the query, a new document is created and inserted by
* combining the query document and the update document.
+ *
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be upserted. Must not be
* {@literal null}.
@@ -1549,6 +1600,9 @@ default long exactCount(Query query, String collectionName) {
/**
* Updates the first object that is found in the collection of the entity class that matches the query document with
* the provided update document.
+ *
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
@@ -1587,7 +1641,10 @@ default long exactCount(Query query, String collectionName) {
/**
* Updates the first object that is found in the specified collection that matches the query document criteria with
- * the provided updated document.
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
@@ -1605,6 +1662,9 @@ default long exactCount(Query query, String collectionName) {
/**
* Updates all objects that are found in the collection for the entity class that matches the query document criteria
* with the provided updated document.
+ *
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
@@ -1642,6 +1702,9 @@ default long exactCount(Query query, String collectionName) {
/**
* Updates all objects that are found in the collection for the entity class that matches the query document criteria
* with the provided updated document.
+ *
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java
index 84d617e177..4abb5e671e 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java
@@ -758,6 +758,9 @@ default
+ *A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ *incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an optional
* fields specification. Must not be {@literal null}.
@@ -773,6 +776,9 @@ default
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an optional
* fields specification. Must not be {@literal null}.
@@ -790,6 +796,9 @@ default
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an optional
* fields specification.
@@ -808,6 +817,9 @@ default
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the {@link Query} class that specifies the {@link Criteria} used to find a document and also an optional
* fields specification. Must not be {@literal null}.
@@ -1190,7 +1202,9 @@ default Mono
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1206,7 +1220,9 @@ default Mono
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1218,6 +1234,11 @@ default Mono
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param batchToSave the batch of objects to save. Must not be {@literal null}.
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
@@ -1229,6 +1250,11 @@ default Mono
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param batchToSave the list of objects to save. Must not be {@literal null}.
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
@@ -1239,6 +1265,11 @@ default Mono
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param objectsToSave the list of objects to save. Must not be {@literal null}.
* @return the saved objects.
@@ -1256,7 +1287,9 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
* @return the inserted objects.
*/
@@ -1264,6 +1297,11 @@ default Mono
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param batchToSave the publisher which provides objects to save. Must not be {@literal null}.
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
@@ -1275,6 +1313,11 @@ default Mono
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param batchToSave the publisher which provides objects to save. Must not be {@literal null}.
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
@@ -1285,6 +1328,11 @@ default Mono
+ * If an object within the batch has an {@literal Id} property which holds a {@literal null} value, it will be set
+ * with the generated Id from MongoDB.
+ *
+ * Inserting new objects will trigger {@link org.springframework.data.annotation.Version} property initialization.
*
* @param objectsToSave the publisher which provides objects to save. Must not be {@literal null}.
* @return the inserted objects.
@@ -1300,7 +1348,11 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
+ *
* The {@code objectToSave} must not be collection-like.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1308,6 +1360,8 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
* @return the saved object.
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
+ * @throws org.springframework.dao.OptimisticLockingFailureException in case of version mismatch in case a
+ * {@link org.springframework.data.annotation.Version} is defined.
*/
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
*
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
* @return the saved object.
* @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
* {@link #getCollectionName(Class) derived} from the given object type.
+ * @throws org.springframework.dao.OptimisticLockingFailureException in case of version mismatch in case a
+ * {@link org.springframework.data.annotation.Version} is defined.
*/
+ * A potential {@link org.springframework.data.annotation.Version} the property will be auto incremented. The
+ * operation raises an error in case the document has been modified in between.
*
* @param objectToSave the object to store in the collReactiveMongoOperationsection. Must not be {@literal null}.
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
* @return the saved object.
+ * @throws org.springframework.dao.OptimisticLockingFailureException in case of version mismatch in case a
+ * {@link org.springframework.data.annotation.Version} is defined.
*/
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
+ *
* NOTE: {@link Query#getSortObject() sorting} is not supported by {@code db.collection.updateOne}.
* Use {@link #findAndModify(Query, UpdateDefinition, Class)} instead.
*
@@ -1406,6 +1479,9 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be upserted. Must not be
* {@literal null}.
@@ -1422,7 +1498,11 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
+ *
* NOTE: {@link Query#getSortObject() sorting} is not supported by {@code db.collection.updateOne}.
* Use {@link #findAndModify(Query, UpdateDefinition, Class)} instead.
*
@@ -1463,7 +1543,10 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
@@ -1481,6 +1564,9 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
@@ -1518,6 +1604,9 @@ default Mono
+ * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
+ * incremented if not explicitly specified in the update.
*
* @param query the query document that specifies the criteria used to select a document to be updated. Must not be
* {@literal null}.
@@ -1533,7 +1622,8 @@ default Mono
- * Insert is used to initially store the object into the database. To update an existing object use the save method.
- *
+ * Insert is used to initially store the object into the database. To update an existing object use the
+ * {@link #save(Object)} method.
+ *
* Insert is used to initially store the object into the database. To update an existing object use the save method.
- *
+ *
+ * Type Conversion" for more details.
+ *
+ * Conversion for more details.
+ *
+ * combining the query document and the update document.
+ *
+ * the provided updated document.
+ *
* Insert is used to initially store the object into the database. To update an existing object use the save method.
- *
+ *
* Insert is used to initially store the object into the database. To update an existing object use the save method.
- *
+ *
* Insert is used to initially store the object into the database. To update an existing object use the save method.
- *
+ *
+ * Type Conversion" for more details.
+ *
+ * combining the query document and the update document.
+ *
+ * the provided update document.
+ *
+ * the provided updated document.
+ *