You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
.populated('nested.reference') should return undefined 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:
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
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: