Populate with retainNullValues enabled & omitting _id throws Cannot read property '$__setValue' of null #9336
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?
Using populate + omitting _id results in the following error if the populated document does not exist and
retainNullValues
is set to true:If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Returning array with populated document/null
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node v12.13.1
Mongoose ^5.10.0
MongoDB v4.2.8
I suspect that
subdoc
should be checked for value null inmaybeRemoveId
in assignVals.jsThe text was updated successfully, but these errors were encountered: