Virtual Population of Field on Embedded Discriminator Not Working When Virtual Field Is Nested Within Embedded Discriminator #6488
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?
Virtual population of field on an embedded discriminator works when the virtual field is at the root of the embedded object schema. However, if the virtual field is nested within the object it will not work.
May be related to: #6487 and #6411
If the current behavior is a bug, please provide the steps to reproduce.
Virtual Population WORKING When Virtual Field Is At Root of Embedded Object Schema
Received correct output with "users_$" populated
Virtual Population NOT WORKING When Virtual Field Is Nested Within Embedded Object Schema
Expected output with "nestedLayer.users_$" populated but received it unpopulated
What is the expected behavior?
Expected "nestedLayer.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: