mongoose - enable `toJSON` for specific virtuals

Viewed 63

I have a mongoose model with a bunch of virtual properties, if I do model.toJSON({ virtuals: true }) all of them will be in the JSON.

Is it possible for me to only do this for particular virtual properties? So instead of all of them a select few will be in the JSON.

0 Answers
Related