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

Unique index not throwing duplicate key error

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.40
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      few places where this is used:
      if(result.documents[0]['$err']...) { return callback(MongoError.create(result.documents[0]));
      e.g. Server.prototype.command, executeSingleOperation ..

      Possible fix:
      /lib/connection/commands.js

      Response.prototype.parse
      ...
      // tell callers of the response body parsing that an error has occurred due to a unique index error (as one possible scenario) - if there is an error let the document be an error for the top level checking to work..
      if (this.documents[i].writeErrors)

      { this.documents[i] = this.documents[i].writeErrors[0]; }

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            christkv Christian Amor Kvalheim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: