Virtual Population of Field on a Nested Embedded Discriminator Not Working When Being Used in Models With Nested Schemas #6487
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I try to populate an embedded discriminator from a model that has a nested schema defined by an Object literal everything works. However, if I do the same but use a nested schema instantiated from mongoose.Schema, it no longer works . See working and non-working example in repro script section.
This may be related to: #6411 and #6488
If the current behavior is a bug, please provide the steps to reproduce.
Here's are some examples:
Virtual Population WORKING When Nested Schema is Defined By An Object Literal
Received correct output with "users_$" populated
Virtual Population NOT WORKING When Nested Schema is by Schema instantiated from mongoose.Schema
Received incorrect output with "users_$" not populated
What is the expected behavior?
Expected "users_$" to be populated
Please mention your node.js, mongoose and MongoDB version.
node: v8.11.1
mongoose: 5.1.1
mongo: 3.6.4
The text was updated successfully, but these errors were encountered: