[JAVA-2525] UpdateFirst with query has sort order not working Created: 29/May/17 Updated: 27/Oct/23 Resolved: 30/May/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Command Operations |
| Affects Version/s: | 3.4.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | RAJESH GUPTA | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Hi Team, |
| Comments |
| Comment by Jeffrey Yemin [ 30/May/17 ] |
|
Hi Rajesh, The MongoDB update command does not support specification of a sort criteria, which is why this isn't working in Spring Data MongoDB. To update a single known document you must specify a query filter that identifies the document uniquely. Alternatively you can use the findAndModify method, which should apply the sort criteria. Note also that Spring Data MongoDB is a separate project with its own issue tracking system: https://jira.spring.io/browse/DATAMONGO/. |