mongoosejs / mongoose-lean-getters

Apply getters on lean() documents: https://mongoosejs.com/docs/tutorials/lean.html
Apache License 2.0
10 stars 15 forks source link

Support for renamed function Query.prototype.transform added in pre find hook. #8

Closed medolino closed 2 years ago

medolino commented 2 years ago

Summary

I find out that Query.prototype.map was renamed to Query.prototype.transform in mongoose 6 (see: https://github.com/Automattic/mongoose/commit/1e485dfdd1ed89235ce68f0f413bce15085c2052). I added additional check for this.transform and kept this.map to ensure backward compatibility. Resolves #6.