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

Handle maps when applying defaults to nested paths #12322

Merged
merged 2 commits into from
Aug 25, 2022
Merged

Conversation

vkarpov15
Copy link
Collaborator

Fix #12220

Summary

The issue is that flattenObjectWithDottedPaths() drills down into Mongoose maps, which leads to infinite recursion because, among other things, maps have an instance of Schema, and Schema -> Mongoose -> Model -> Schema

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.

One minor comment, but otherwise, LGTM.
Thanks! 👍

@vkarpov15 vkarpov15 merged commit 9734768 into master Aug 25, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12220 branch August 25, 2022 01:17
@hasezoey hasezoey added this to the 6.5.3 milestone Sep 1, 2022
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.

"RangeError: Maximum call stack size exceeded" after upgrading from mongoose 6.4.5 to 6.5.1
3 participants