diff --git a/lib/error/cast.js b/lib/error/cast.js index f7df49b8c7e..115927117f7 100644 --- a/lib/error/cast.js +++ b/lib/error/cast.js @@ -75,7 +75,6 @@ class CastError extends MongooseError { * ignore */ setModel(model) { - this.model = model; this.message = formatMessage(model, this.kind, this.value, this.path, this.messageFormat, this.valueType); } diff --git a/types/error.d.ts b/types/error.d.ts index 226fad31931..3fec7c41399 100644 --- a/types/error.d.ts +++ b/types/error.d.ts @@ -28,7 +28,6 @@ declare module 'mongoose' { value: any; path: string; reason?: NativeError | null; - model?: any; constructor(type: string, value: any, path: string, reason?: NativeError, schemaType?: SchemaType); }