mongoosejs / mongoose-lean-virtuals

Attach virtuals to the results of mongoose lean() queries
Apache License 2.0
45 stars 24 forks source link

fix transform returning undefined w/ cursor #12

Closed nicolas-marien closed 6 years ago

nicolas-marien commented 6 years ago

Almost the same as #11 but here it is for when used w/ .lean({ virtuals: true }). In the case this plugin is hooked on transforms, which are applied in a .reduce (here), but undefined is returned since the document is mutated but not returned.

nicolas-marien commented 6 years ago

Thank you for merging this ! 🍪