[SERVER-5053] Return dupKey as field in getLastError on dup (not in string only) Created: 23/Feb/12  Updated: 23/Feb/12  Resolved: 23/Feb/12

Status: Closed
Project: Core Server
Component/s: Internal Code, Usability
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Scott Hernandez (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 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
}



 Comments   
Comment by Eliot Horowitz (Inactive) [ 23/Feb/12 ]

See SERVER-4637

Generated at Thu Feb 08 03:07:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.