mongoose-field-encryption icon indicating copy to clipboard operation
mongoose-field-encryption copied to clipboard

.lean() with post-hook of .find and .findOne

Open doguhanokumus opened this issue 3 years ago • 1 comments

Hi again 😊

I also had to use .lean functionality in our business as we have over 250 queries running throughout our projects and it would take much more time to replace them all.

So I've added the workaround I came up with, mapping after the document(s) are returned with the post hook for find and findOne.

This seems to be working fine with our tests, I hope you can have time to verify and merge soon.

Doguhan

doguhanokumus avatar Jun 17 '21 17:06 doguhanokumus

Hi @doguhanokumus

This looks good but we definitely need a few tests to verify that the feature works as expected. If you can add them, I'd be happy to merge.

Thanks,

wheresvic avatar Oct 01 '21 08:10 wheresvic