Populating ObjectId that has No Document Match Should Be Null - Breaking Change from Older Versions #9913
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
Milestone
Do you want to request a feature or report a bug?
Reporting a bug
What is the current behavior?
Currently, if populating an ObjectId that does not resolve to an actual document, in certain cases, the results still have the ObjectId instead of null.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
After the populate, any ObjectIds that did not resolve to a document should be null.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js: 12.18.3
MongoDB: 3.6.21
Mongoose: 5.11.15
Thank you!
The text was updated successfully, but these errors were encountered: