SchemaType-level global setters to go along with global getters #13510
Labels
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
new feature
This change adds new functionality, like a new method or class
Milestone
Prerequisites
🚀 Feature Proposal
In #11462, I ran into an issue where you can set a global getter on all date instances:
But there's no way to set a corresponding global setter.
Motivation
Getters and setters are complementary, and while it is definitely possible to get a lot out of global getters without global setters, having both is necessary.
The major roadblock is that we use
SchemaType.get()
to define global getters... butSchemaType.set()
is already used to set global schematype options. So we may instead need to do something likemongoose.Schema.Types.Date.setters.push(...)
instead ofmongoose.Schema.Types.Date.set()
.Example
No response
The text was updated successfully, but these errors were encountered: