Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5171

Interface UpdateResult incorrect type definition

    • 1
    • 2
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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;
      } 

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            software@soisystems.com John Wilson
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: