Apply sort to replace and bulk operation updates

Allow using sort parameter from the query for template replace as well as bulk update & replace operations.
We now also mapped fields used in sort to the domain type considering field annotations.
Also updated javadoc and reference documentation.

Original Pull Request: #4888
This commit is contained in:
Christoph Strobl
2025-03-03 09:30:04 +01:00
parent 019d915fa2
commit d79031b60d
17 changed files with 343 additions and 152 deletions

View File

@@ -356,7 +356,7 @@ Read more in the see xref:mongodb/template-crud-operations.adoc#mongo-template.o
* *updateFirst*: Updates the first document that matches the query document criteria with the updated document.
* *updateMulti*: Updates all objects that match the query document criteria with the updated document.
WARNING: `updateFirst` does not support ordering. Please use xref:mongodb/template-crud-operations.adoc#mongo-template.find-and-upsert[findAndModify] to apply `Sort`.
WARNING: `updateFirst` does not support ordering for MongoDB Versions below 8.0. Running one of the older versions, please use xref:mongodb/template-crud-operations.adoc#mongo-template.find-and-upsert[findAndModify] to apply `Sort`.
NOTE: Index hints for the update operation can be provided via `Query.withHint(...)`.