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
Closed
Assignees

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented May 30, 2017

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

@spring-projects-issues spring-projects-issues commented Jul 4, 2017

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

Loading

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 6, 2021

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.

Loading

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 13, 2021

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.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants