Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-17532

Duplicate key error message does not contain index name anymore

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Hide

      In mongo shell:

      db.test.insert({_id: "test"})
      db.test.insert({_id: "test"})
      

      Result with WiredTiger:

      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 11000,
      		"errmsg" : "E11000 duplicate key error dup key: { : \"test\" }"
      	}
      })
      

      Result with MMAPv1:

      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 11000,
      		"errmsg" : "E11000 duplicate key error index: rfy.test.$_id_ dup key: { : \"test\" }"
      	}
      })
      

      Show
      In mongo shell: db.test.insert({_id: "test"}) db.test.insert({_id: "test"}) Result with WiredTiger: WriteResult({ "nInserted" : 0, "writeError" : { "code" : 11000, "errmsg" : "E11000 duplicate key error dup key: { : \"test\" }" } }) Result with MMAPv1: WriteResult({ "nInserted" : 0, "writeError" : { "code" : 11000, "errmsg" : "E11000 duplicate key error index: rfy.test.$_id_ dup key: { : \"test\" }" } })

    Description

      With WiredTiger, the error returned by a duplicate key does not contain the name of the violated unique index. It is therefore not possible to identify which field in the inserted document causes the violation.

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            rainer.frey@inxmail.de Rainer Frey
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: