-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
new featureThis change adds new functionality, like a new method or classThis change adds new functionality, like a new method or class
Description
Prerequisites
- I have written a descriptive issue title
Mongoose version
9.0.1
Node.js version
24.11.0
MongoDB version
n/a
Operating system
None
Operating system version (i.e. 20.04, 11.3, 10)
No response
Issue
I think that users should be allowed to configure whether they want inferred types to include | null for ANY type (even optional ones) unless explicitly included. Maybe an option inside interface DefaultSchemaOptions?
My rational is that when users create separate interfaces and use them to define their schema instead of using automatic type inference, I very rarely see people include | null for EVERY OPTIONAL TYPE. Despite it being possible for null values to be stored, most users do not want to deal with it in their types. I guess this relates to #14421.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
new featureThis change adds new functionality, like a new method or classThis change adds new functionality, like a new method or class