diff --git a/test/types/document.test.ts b/test/types/document.test.ts index 3319a4a59a6..dfb476cb55f 100644 --- a/test/types/document.test.ts +++ b/test/types/document.test.ts @@ -192,8 +192,6 @@ function autoTypedDocument() { expectType(AutoTypeModelInstance.userName); expectType(AutoTypeModelInstance.favoritDrink); expectType(AutoTypeModelInstance.favoritColorMode); - expectType(AutoTypeModelInstance.unExistProperty); - expectType(AutoTypeModelInstance.description); // Document-Methods-tests expectType>(new AutoTypedModel().instanceFn()); diff --git a/types/models.d.ts b/types/models.d.ts index f5c6ae19167..02401e33924 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -119,7 +119,7 @@ declare module 'mongoose' { AcceptsDiscriminator, IndexManager, SessionStarter { - new (doc?: DocType, fields?: any | null, options?: boolean | AnyObject): HydratedDocument, TMethodsAndOverrides, TVirtuals> & ObtainSchemaGeneric; + new (doc?: DocType, fields?: any | null, options?: boolean | AnyObject): HydratedDocument & ObtainSchemaGeneric; aggregate(pipeline?: PipelineStage[], options?: mongodb.AggregateOptions, callback?: Callback): Aggregate>; aggregate(pipeline: PipelineStage[], callback?: Callback): Aggregate>;