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

fix(array): track correct changes when setting nested array of primitives #13422

Merged
merged 5 commits into from May 23, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13372

Summary

The problem is that, for nested arrays of primitives, the array's internal path is intArr.$ rather than intArr.0. This causes problems when trying to set the path directly, because then Mongoose marks intArr.$.0 as modified.

Examples

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! 👍

test/types.array.test.js Outdated Show resolved Hide resolved
@vkarpov15 vkarpov15 merged commit d2cfd25 into master May 23, 2023
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-13372 branch May 23, 2023 21:34
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.

Error when trying to update primitives at the bottom of multidimensional arrays
4 participants