Skip to content

Commit

Permalink
Merge pull request #14947 from Automattic/vkarpov15/gh-14946
Browse files Browse the repository at this point in the history
types: re-export DeleteResult and UpdateResult from MongoDB Node.js driver
  • Loading branch information
vkarpov15 authored Oct 13, 2024
2 parents 02c5efd + 081d9ea commit f34935d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/types/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions types/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ declare module 'mongoose' {
};

type UpdateWriteOpResult = mongodb.UpdateResult;
type UpdateResult = mongodb.UpdateResult;
type DeleteResult = mongodb.DeleteResult;

interface MapReduceOptions<T, K, R> {
map: Function | string;
Expand Down

0 comments on commit f34935d

Please sign in to comment.