-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
enhancementThis issue is a user-facing general improvement that doesn't fix a bug or add a new featureThis issue is a user-facing general improvement that doesn't fix a bug or add a new featurenew featureThis change adds new functionality, like a new method or classThis change adds new functionality, like a new method or class
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
I have found in issues and PR that .lean()
supports a transform: (obj: any) => void
function which is used to mutate the object retrieved from db post lean. The problem being that we need to put this function in every .lean()
call.
I think it'd be nicer if we could have a leanTransform: (obj: any) => void
option saved into the schema to avoid spreading the same transform function (or rather, set as base), similarly to what already exists for toObject
and toJSON
(schema.options.toObject.transform
)
Metadata
Metadata
Assignees
Labels
enhancementThis issue is a user-facing general improvement that doesn't fix a bug or add a new featureThis issue is a user-facing general improvement that doesn't fix a bug or add a new featurenew featureThis change adds new functionality, like a new method or classThis change adds new functionality, like a new method or class