A population of virtual type in the nested path is not visible in toJSON. #13189
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
7.0.2
Node.js version
v16.13.2
MongoDB version
4.4
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
11.3
Issue
I have an issue about
toJSON
in a nested virtual path.As shown in the code below, I have populated the virtual type of the path in the multi-level and I see that the data of c1, c2 exists. But when I do the
toJSON
, I don't see that data.{ toJSON: { virtuals: true }
option also didn't work. I would like your help if you can solve this problem.Example Code
The text was updated successfully, but these errors were encountered: