From 67d016f69d2ab2feb3212c34467e7b951d3f6a8f Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Wed, 15 Apr 2020 09:35:20 +0200 Subject: [PATCH] Use correct typings for the result of `getUpsertedIds()` 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.