You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Mongoose version
8.6.4
Node.js version
22.13
MongoDB server version
6
Typescript version (if applicable)
5.7.0
Description
The parameter types for SchemaType.Number.min appear to be incorrect. Looking at the definition here, message is required. However, looking at the docs, message is optional. Looking at the few instances where I use .min in a project, I don't provide the message argument to min and the code functions as expected, so I believe the types are just incorrect here.
Steps to Reproduce
Call mySchema.path<mongoose.Schema.Types.Number>('myField').min(0), where myField is defined as a numeric field. Observe that the TS compiler complains about a missing argument:
Expected Behavior
message should be an optional parameter
The text was updated successfully, but these errors were encountered:
Prerequisites
Mongoose version
8.6.4
Node.js version
22.13
MongoDB server version
6
Typescript version (if applicable)
5.7.0
Description
The parameter types for
SchemaType.Number.min
appear to be incorrect. Looking at the definition here,message
is required. However, looking at the docs,message
is optional. Looking at the few instances where I use.min
in a project, I don't provide themessage
argument tomin
and the code functions as expected, so I believe the types are just incorrect here.Steps to Reproduce
Call
mySchema.path<mongoose.Schema.Types.Number>('myField').min(0)
, wheremyField
is defined as a numeric field. Observe that the TS compiler complains about a missing argument:Expected Behavior
message
should be an optional parameterThe text was updated successfully, but these errors were encountered: