I'm designing a custom ODM and have model classes for each collection document. The model classes return a modified document result (eg: removes password field from user)
I've faced a frustrating problem that I'm unsure on how to solve effectively.
The mongodb collection find
function returns a cursor. I want that cursor to return a modified forEach
and toArray
based on the Model's modified document result. How should I go about this?
Notes:
If it helps, I come from a Laravel PHP MySQL background