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

global option to set new on all findAndUpdate operations #9183

Closed
AbdelrahmanHafez opened this issue Jun 27, 2020 · 0 comments
Closed

global option to set new on all findAndUpdate operations #9183

AbdelrahmanHafez opened this issue Jun 27, 2020 · 0 comments
Labels
new feature This change adds new functionality, like a new method or class
Milestone

Comments

@AbdelrahmanHafez
Copy link
Collaborator

AbdelrahmanHafez commented Jun 27, 2020

new option on findOneAndUpdate is a common gotcha to people using mongoose, I personally have been confused by it before.

I believe most people would prefer to have findOneAndUpdate return the new document by default, we should provide a global option that allows people to control the default behavior.

@AbdelrahmanHafez AbdelrahmanHafez added the new feature This change adds new functionality, like a new method or class label Jun 27, 2020
@AbdelrahmanHafez AbdelrahmanHafez added this to the 5.10 milestone Jun 27, 2020
AbdelrahmanHafez added a commit to AbdelrahmanHafez/mongoose that referenced this issue Jul 2, 2020
AbdelrahmanHafez added a commit to AbdelrahmanHafez/mongoose that referenced this issue Jul 2, 2020
vkarpov15 added a commit that referenced this issue Jul 19, 2020
add mongoose default option to set `returnOriginal`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This change adds new functionality, like a new method or class
Projects
None yet
Development

No branches or pull requests

2 participants