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

Incorrect return value for UpdateOne #11055

Closed
wants to merge 1 commit into from
Closed

Incorrect return value for UpdateOne #11055

wants to merge 1 commit into from

Conversation

bbradshaw
Copy link

The docs claim that the results from updateOne() contain an "modifiedCount" field identical to Mongo, but testing with Mongoose 5.12 shows that the actual field is named "nModified" instead.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory.

If you're making a change to documentation, do not modify a .html file directly. Instead find the corresponding .pug file or test case in the test/docs directory.

Summary

Examples

The docs claim that the results from updateOne() contain an "modifiedCount" field identical to Mongo, but testing with Mongoose 5.12 shows that the actual field is named "nModified" instead.
@vkarpov15
Copy link
Collaborator

That's because this behavior changed in Mongoose 6. In Mongoose 6, the field is modifiedCount, not nModified.

@vkarpov15 vkarpov15 closed this Dec 7, 2021
@bbradshaw
Copy link
Author

@vkarpov15 Perhaps this is the wrong document to edit, but this is what shows up when you are looking at the Mongoose 5 docs:

https://mongoosejs.com/docs/5.x/docs/models.html

@vkarpov15 vkarpov15 reopened this Dec 9, 2021
@vkarpov15 vkarpov15 added this to the 5.13.14 milestone Dec 9, 2021
vkarpov15 added a commit that referenced this pull request Dec 27, 2021
@vkarpov15 vkarpov15 closed this Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants