-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Bug: .populated within an array seems inconsistent. #8247
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Comments
vkarpov15
added
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Oct 17, 2019
vkarpov15
added a commit
that referenced
this issue
Oct 20, 2019
vkarpov15
added a commit
that referenced
this issue
Oct 21, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the current behavior?
A model containing an array of another schema, which itself has a reference to another model. When calling
.populated('nested.reference')
the result doesn't appear to match the length of the array if you have pushed new items into the array.https://gist.github.com/dave-continuum-media/09848138ae86508d891c65bddc537b20
What is the expected behavior?
.populated('nested.reference')
should returnundefined
if none of the items are populated but an array of equal length to the sub-schema array if some or all are.Currently it takes extra effort to tell if a document subschema array has been fully populated:
The text was updated successfully, but these errors were encountered: