select: false
does not work as part of a Child Schema if Child Schema is used more than once
#5603
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?
In the script below, when we pull the parent document, we see that
child
comes back as{}
, butchild2
comes back as{ field: 'test'}
despite the fact thatChildSchema.field
hasselect: false
.When looking at the debugger, only
child.field
is being selected out andchild2.field
is not.Please mention your node.js, mongoose and MongoDB version.
4.11.8
The text was updated successfully, but these errors were encountered: