Skip to content

Commit

Permalink
Merge pull request #14977 from Automattic/vkarpov15/insert-many-resul…
Browse files Browse the repository at this point in the history
…t-interface

types(model): convert InsertManyResult to interface and remove unnecessary insertedIds override
  • Loading branch information
vkarpov15 authored Oct 23, 2024
2 parents 6c55767 + 9b1164c commit c342fc4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions types/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ declare module 'mongoose' {
throwOnValidationError?: boolean;
}

type InsertManyResult<T> = mongodb.InsertManyResult<T> & {
insertedIds: {
[key: number]: InferId<T>;
};
interface InsertManyResult<T> extends mongodb.InsertManyResult<T> {
mongoose?: { validationErrors?: Array<Error.CastError | Error.ValidatorError> };
};
}

type UpdateWriteOpResult = mongodb.UpdateResult;
type UpdateResult = mongodb.UpdateResult;
Expand Down

0 comments on commit c342fc4

Please sign in to comment.