-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(document): allow populating deeply nested models as strings #11168
Conversation
This reverts commit b41cd1e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do if (subPopulate != null && typeof subPopulate === 'object')
Remember that typeof null === 'object'
@vkarpov15 |
@vkarpov15, at first I also thought that this check is needed. But then I looked around the code and realized that this check was unnecessary. Line 4614 already excludes falsy values. Is not it? |
@Kamikadze4GAME is right, thanks for pointing that out. I'll merge this and fix in master so we can get this out. |
fixes #11160
@vkarpov15
This change means that we won't report the full path if a user uses
populate: 'websiteId'
because we can't assign a property to a string.Can you think of a way to overcome this?
Even with this caveat, I think it's best we have populate in the first place, then we can work on improving the error message being reported.