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: added fix to populate a nested document field inside an array parent when using path string #14443

Closed
wants to merge 1 commit into from

Conversation

FaizBShah
Copy link
Contributor

@FaizBShah FaizBShah commented Mar 17, 2024

Fixes #14435

Summary
Added the fix to handle population of fields inside a nested document schema, when the schema of the document is 'nested'. In some cases, as in the issue attached, where the nested document was inside a parent which is an array, the schema of the field might turn out to be 'nested' in the document.get() function and thus the population was failing and throwing an error, even though intuitively the path made sense. Now, since 'nested' is a string, therefore it won't have the .applyGetters() function which is present in other schemas, and thus it threw error. Therefore excluded the 'nested' schema from calling that function and preventing failing of the population logic. The result populated data is still correct as by the time this function is called, the population of data for a nested document is already done

Examples
Have added subsequent tests.

@FaizBShah
Copy link
Contributor Author

Tagging @vkarpov15 for review

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.

Nested populate with nested paths and subdocuments is not working fine
1 participant