Skip to content

Commit

Permalink
fix(types): add missing typedefs for bulkSave() to 5.x
Browse files Browse the repository at this point in the history
Fix #12019
  • Loading branch information
vkarpov15 committed Feb 20, 2023
1 parent 896cd76 commit e33a8be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,13 @@ declare module 'mongoose' {
bulkWrite(writes: Array<any>, options?: mongodb.CollectionBulkWriteOptions): Promise<mongodb.BulkWriteOpResultObject>;
bulkWrite(writes: Array<any>, options?: mongodb.CollectionBulkWriteOptions, cb?: Callback<mongodb.BulkWriteOpResultObject>): void;

/**
* Sends multiple `save()` calls in a single `bulkWrite()`. This is faster than
* sending multiple `save()` calls because with `bulkSave()` there is only one
* network round trip to the MongoDB server.
*/
bulkSave(documents: Array<Document>): Promise<mongodb.BulkWriteResult>;

/** Collection the model uses. */
collection: Collection;

Expand Down

0 comments on commit e33a8be

Please sign in to comment.