Skip to content

Commit f34935d

Browse files
authored
Merge pull request #14947 from Automattic/vkarpov15/gh-14946
types: re-export DeleteResult and UpdateResult from MongoDB Node.js driver
2 parents 02c5efd + 081d9ea commit f34935d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/types/models.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import mongoose, {
1414
UpdateWriteOpResult,
1515
AggregateOptions,
1616
WithLevel1NestedPaths,
17-
NestedPaths,
18-
InferSchemaType
17+
InferSchemaType,
18+
DeleteResult
1919
} from 'mongoose';
2020
import { expectAssignable, expectError, expectType } from 'tsd';
2121
import { AutoTypedSchemaType, autoTypedSchema } from './schema.test';
@@ -514,7 +514,7 @@ function gh12100() {
514514
function modelRemoveOptions() {
515515
const cmodel = model('Test', new Schema());
516516

517-
cmodel.deleteOne({}, {});
517+
const res: DeleteResult = await cmodel.deleteOne({}, {});
518518
}
519519

520520
async function gh12286() {

types/models.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ declare module 'mongoose' {
7272
};
7373

7474
type UpdateWriteOpResult = mongodb.UpdateResult;
75+
type UpdateResult = mongodb.UpdateResult;
76+
type DeleteResult = mongodb.DeleteResult;
7577

7678
interface MapReduceOptions<T, K, R> {
7779
map: Function | string;

0 commit comments

Comments
 (0)