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

Return dupKey as field in getLastError on dup (not in string only)

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Internal Code, Usability

    Description

      Add the key/index fields as shown below.

      E11000 duplicate key error index: test.people.$_id_  dup key: { : ObjectId('4e683574bc4135eee514713f') }
      > db.getLastErrorObj()
      {
              "err" : "E11000 duplicate key error index: test.people.$_id_  dup key: { : ObjectId('4e683574bc4135eee514713f') }",
              "code" : 11000,
              "key": { "_id" : ObjectId('4e683574bc4135eee514713f') }
              "index" : "test.people.$_id_",
              "n" : 0,
              "connectionId" : 1777,
              "ok" : 1
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: