alexsk / mongoose-intl

Mongoose schema plugin for multilingual fields
MIT License
74 stars 31 forks source link

Using virtuals with full languages. #27

Open eliomaria opened 5 years ago

eliomaria commented 5 years ago

I need to use both .toObject() and .toJSON() options of my model and i have defined other virtual fields that i required.

Is there a way that i can use in my model: toJSON: { virtuals: true }, toObject: { virtuals: true } and receive both the fields i need and the full language object as well? As far as i understood with the library, if i use the virtual it will override the object and return only the default language. Is there any option to override this?

Thank you in advance.