From 2ab88c2a44f9e5eb846b8d3ddd8e01586106a292 Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Sat, 16 May 2020 13:27:06 +0200 Subject: [PATCH] fix: use correct typings for the result of `getUpsertedIds()` (#5878) This method returns an object with `_id` and `index` properties, according to [the description of `BulkWriteResult`](https://docs.mongodb.com/manual/reference/method/BulkWriteResult/#BulkWriteResult.upserted). --- src/driver/mongodb/typings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/mongodb/typings.ts b/src/driver/mongodb/typings.ts index 319319a1d5..9ec1f61d6f 100644 --- a/src/driver/mongodb/typings.ts +++ b/src/driver/mongodb/typings.ts @@ -4271,7 +4271,7 @@ export interface BulkWriteResult { /** * Return an array of upserted ids. */ - getUpsertedIds(): Array; + getUpsertedIds(): Array<{ _id: string, index: number }>; /** * Retrieve the write concern error if any.