While working with Node.js, Mongoose and MongoDB, I have found that my Mongoose schema getters and setters do not fire when I perform a findOne query.
I have found an ol
I was having the same problem with getters not modifying the returned documents when querying with Mongoose. To make this apply to every query, you can do this:
// Enable Mongoose getter functions schema.set('toObject', { getters: true }); schema.set('toJSON', { getters: true });