2525
2626import org .bson .Document ;
2727import org .springframework .data .domain .KeysetScrollPosition ;
28+ import org .springframework .data .domain .Sort ;
2829import org .springframework .data .domain .Window ;
2930import org .springframework .data .geo .GeoResults ;
3031import org .springframework .data .mongodb .core .BulkOperations .BulkMode ;
@@ -1604,8 +1605,9 @@ default long exactCount(Query query, String collectionName) {
16041605 * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be
16051606 * auto-incremented if not explicitly specified in the update.
16061607 *
1607- * @param query the query document that specifies the criteria used to select a document to be updated. Must not be
1608- * {@literal null}.
1608+ * @param query the query document that specifies the criteria used to select a document to be updated. The
1609+ * {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to update when
1610+ * potentially matching multiple candidates. Must not be {@literal null}.
16091611 * @param update the {@link UpdateDefinition} that contains the updated object or {@code $} operators to manipulate
16101612 * the existing. Must not be {@literal null}.
16111613 * @param entityClass class that determines the collection to use.
@@ -1623,12 +1625,11 @@ default long exactCount(Query query, String collectionName) {
16231625 * the provided updated document. <br />
16241626 * <strong>NOTE:</strong> Any additional support for field mapping, versions, etc. is not available due to the lack of
16251627 * domain type information. Use {@link #updateFirst(Query, UpdateDefinition, Class, String)} to get full type specific
1626- * support. <br />
1627- * <strong>NOTE:</strong> {@link Query#getSortObject() sorting} is not supported by {@code db.collection.updateOne}.
1628- * Use {@link #findAndModify(Query, UpdateDefinition, Class, String)} instead.
1628+ * support.
16291629 *
1630- * @param query the query document that specifies the criteria used to select a document to be updated. Must not be
1631- * {@literal null}.
1630+ * @param query the query document that specifies the criteria used to select a document to be updated. The
1631+ * {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to update when
1632+ * potentially matching multiple candidates. Must not be {@literal null}.
16321633 * @param update the {@link UpdateDefinition} that contains the updated object or {@code $} operators to manipulate
16331634 * the existing. Must not be {@literal null}.
16341635 * @param collectionName name of the collection to update the object in. Must not be {@literal null}.
@@ -1646,8 +1647,9 @@ default long exactCount(Query query, String collectionName) {
16461647 * A potential {@link org.springframework.data.annotation.Version} property of the {@literal entityClass} will be auto
16471648 * incremented if not explicitly specified in the update.
16481649 *
1649- * @param query the query document that specifies the criteria used to select a document to be updated. Must not be
1650- * {@literal null}.
1650+ * @param query the query document that specifies the criteria used to select a document to be updated. The
1651+ * {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to update when
1652+ * potentially matching multiple candidates. Must not be {@literal null}.
16511653 * @param update the {@link UpdateDefinition} that contains the updated object or {@code $} operators to manipulate
16521654 * the existing. Must not be {@literal null}.
16531655 * @param entityClass class of the pojo to be operated on. Must not be {@literal null}.
@@ -1833,7 +1835,8 @@ default long exactCount(Query query, String collectionName) {
18331835 *
18341836 * @param query the {@link Query} class that specifies the {@link Criteria} used to find a document. The query may
18351837 * contain an index {@link Query#withHint(String) hint} or the {@link Query#collation(Collation) collation}
1836- * to use. Must not be {@literal null}.
1838+ * to use. The {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to
1839+ * replace when potentially matching multiple candidates. Must not be {@literal null}.
18371840 * @param replacement the replacement document. Must not be {@literal null}.
18381841 * @return the {@link UpdateResult} which lets you access the results of the previous replacement.
18391842 * @throws org.springframework.data.mapping.MappingException if the collection name cannot be
@@ -1850,7 +1853,8 @@ default <T> UpdateResult replace(Query query, T replacement) {
18501853 *
18511854 * @param query the {@link Query} class that specifies the {@link Criteria} used to find a document. The query may
18521855 * contain an index {@link Query#withHint(String) hint} or the {@link Query#collation(Collation) collation}
1853- * to use. Must not be {@literal null}.
1856+ * to use. The {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to
1857+ * replace when potentially matching multiple candidates. Must not be {@literal null}.
18541858 * @param replacement the replacement document. Must not be {@literal null}.
18551859 * @param collectionName the collection to query. Must not be {@literal null}.
18561860 * @return the {@link UpdateResult} which lets you access the results of the previous replacement.
@@ -1866,7 +1870,8 @@ default <T> UpdateResult replace(Query query, T replacement, String collectionNa
18661870 *
18671871 * @param query the {@link Query} class that specifies the {@link Criteria} used to find a document.The query may
18681872 * contain an index {@link Query#withHint(String) hint} or the {@link Query#collation(Collation) collation}
1869- * to use. Must not be {@literal null}.
1873+ * to use. The {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to
1874+ * replace when potentially matching multiple candidates. Must not be {@literal null}.
18701875 * @param replacement the replacement document. Must not be {@literal null}.
18711876 * @param options the {@link ReplaceOptions} holding additional information. Must not be {@literal null}.
18721877 * @return the {@link UpdateResult} which lets you access the results of the previous replacement.
@@ -1884,7 +1889,8 @@ default <T> UpdateResult replace(Query query, T replacement, ReplaceOptions opti
18841889 *
18851890 * @param query the {@link Query} class that specifies the {@link Criteria} used to find a document. The query may *
18861891 * contain an index {@link Query#withHint(String) hint} or the {@link Query#collation(Collation) collation}
1887- * to use. Must not be {@literal null}.
1892+ * to use. The {@link Query} may define a {@link Query#with(Sort) sort order} to influence which document to
1893+ * replace when potentially matching multiple candidates. Must not be {@literal null}.
18881894 * @param replacement the replacement document. Must not be {@literal null}.
18891895 * @param options the {@link ReplaceOptions} holding additional information. Must not be {@literal null}.
18901896 * @return the {@link UpdateResult} which lets you access the results of the previous replacement.
0 commit comments