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(populate): correctly set populatedModelSymbol on documents populated using Model.populate() #13588

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13575

Summary

A bit of a nasty issue: populate() relies on getModelsMapForPopulate() to set populatedModelSymbol on the passed in options to set the model being populated, so future calls know what model this path was populated with. But shallow cloning in Model.populate() breaks that.

I'd love to do some refactoring here, but will hold off for now because that can take a long time.

Examples

@vkarpov15 vkarpov15 merged commit 1a998e2 into master Jul 9, 2023
32 of 34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-13575 branch July 9, 2023 16:28
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.

Ref array .push crashes with "Model is not a constructor" if populated in .find().cursor() call
2 participants