diff --git a/test/types/models.test.ts b/test/types/models.test.ts index a99f6ffa02..2575ad3133 100644 --- a/test/types/models.test.ts +++ b/test/types/models.test.ts @@ -14,8 +14,8 @@ import mongoose, { UpdateWriteOpResult, AggregateOptions, WithLevel1NestedPaths, - NestedPaths, - InferSchemaType + InferSchemaType, + DeleteResult } from 'mongoose'; import { expectAssignable, expectError, expectType } from 'tsd'; import { AutoTypedSchemaType, autoTypedSchema } from './schema.test'; @@ -514,7 +514,7 @@ function gh12100() { function modelRemoveOptions() { const cmodel = model('Test', new Schema()); - cmodel.deleteOne({}, {}); + const res: DeleteResult = await cmodel.deleteOne({}, {}); } async function gh12286() { diff --git a/types/models.d.ts b/types/models.d.ts index 0a5e6e3a58..84fc412ba0 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -72,6 +72,8 @@ declare module 'mongoose' { }; type UpdateWriteOpResult = mongodb.UpdateResult; + type UpdateResult = mongodb.UpdateResult; + type DeleteResult = mongodb.DeleteResult; interface MapReduceOptions { map: Function | string;