Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateFirst with query has sort order not working [DATAMONGO-1704] #2616

Closed
spring-projects-issues opened this issue May 30, 2017 · 3 comments
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

RAJESH GUPTA opened DATAMONGO-1704 and commented

Hi Team,
I am using Spring Mongo operations and I want to use updateFirst() command. In this method we have to pass the query with criteria. The query has some criterias with Sort Order also but during the updateFirst() it doesn't include the order


Issue Links:

  • DATAMONGO-1731 Improve JavaDoc of MongoOperations update / findAndModify methods
@spring-projects-issues
Copy link
Author

Christoph Strobl commented

Thank you RAJESH GUPTA.
updateFirst triggers db.collection.updateOne which does not have sort.
However you might want to try findAndModify which will take sort into account by using db.collection.findOneAndUpdate operation.

I've opened DATAMONGO-1731 to tweak documentation

@spring-projects-issues spring-projects-issues added status: waiting-for-feedback We need additional information before we can continue type: bug A general bug in: core Issues in core support labels Dec 30, 2020
@spring-projects-issues
Copy link
Author

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 6, 2021
@spring-projects-issues
Copy link
Author

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants