-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Unknown
-
Affects Version/s: 5.1.0
-
Component/s: TypeScript
What problem are you facing?
UpdateResult member upsertedId returns null when no upsert takes place, but the type definition declares that it is always ObjectId. This is wrong.
What driver and relevant dependency versions are you using?
mongodb 5.1.0
Steps to reproduce?
/** @public */ export interface UpdateResult { /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ acknowledged: boolean; /** The number of documents that matched the filter */ matchedCount: number; /** The number of documents that were modified */ modifiedCount: number; /** The number of documents that were upserted */ upsertedCount: number; /** The identifier of the inserted document if an upsert took place */ upsertedId: ObjectId; }
- is duplicated by
-
NODE-4441 `UpdateResult.upsertedId` type does not take null or schema into account
-
- Closed
-
-
NODE-4134 Wrong TS type for upsertedId (can be null)
-
- Closed
-
- is related to
-
NODE-4134 Wrong TS type for upsertedId (can be null)
-
- Closed
-
- related to
-
NODE-4441 `UpdateResult.upsertedId` type does not take null or schema into account
-
- Closed
-