Add Schema#virtuals
to docs as a public property
#10829
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
It's easy to loop around all paths with
schema.eachPath
but not for vituals, It'll be really helpfull to have somthing likeschema.eachVirtualPath
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
now you have to do:
instead of something like:
Obviously you can always do:
I don't like the first approach as it's a inner prop and you can change it whenever you want, even set it as private or use a
Symbol
.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
mongoose: 6.0.7
node: 16.10.0
mongodb atlas: 4.4.9
The text was updated successfully, but these errors were encountered: