Skip to content

Commit e33a8be

Browse files
committed
fix(types): add missing typedefs for bulkSave() to 5.x
Fix #12019
1 parent 896cd76 commit e33a8be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,13 @@ declare module 'mongoose' {
803803
bulkWrite(writes: Array<any>, options?: mongodb.CollectionBulkWriteOptions): Promise<mongodb.BulkWriteOpResultObject>;
804804
bulkWrite(writes: Array<any>, options?: mongodb.CollectionBulkWriteOptions, cb?: Callback<mongodb.BulkWriteOpResultObject>): void;
805805

806+
/**
807+
* Sends multiple `save()` calls in a single `bulkWrite()`. This is faster than
808+
* sending multiple `save()` calls because with `bulkSave()` there is only one
809+
* network round trip to the MongoDB server.
810+
*/
811+
bulkSave(documents: Array<Document>): Promise<mongodb.BulkWriteResult>;
812+
806813
/** Collection the model uses. */
807814
collection: Collection;
808815

0 commit comments

Comments
 (0)