Skip to content

fix(populate): correctly set populatedModelSymbol on documents populated using Model.populate()#13588

Merged
vkarpov15 merged 1 commit intomasterfrom
vkarpov15/gh-13575
Jul 9, 2023
Merged

fix(populate): correctly set populatedModelSymbol on documents populated using Model.populate()#13588
vkarpov15 merged 1 commit intomasterfrom
vkarpov15/gh-13575

Conversation

@vkarpov15
Copy link
Copy Markdown
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
@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