Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
2.1.1
-
None
-
Mac OSX 10.7.4
MongoDB 2.1.1
-
Query
-
ALL
Description
db.getPrevError() returns an object with an err message that includes the incorrect error code.
> db.x.drop()
|
> db.x.createIndex({ name: 1 }, { unique: 1 })
|
> db.x.insert({ name: 'aaron' })
|
> db.x.insert({ name: 'another' })
|
> db.x.update({ name: 'aaron' }, { $set: { name: 'another' }})
|
E11000 duplicate key error index: test.x.$name_1 dup key: { : "another" }
|
> db.getPrevError()
|
{
|
"err" : "E11000 duplicate key error index: test.x.$name_1 dup key: { : \"another\" }",
|
"code" : 11001,
|
"n" : 0,
|
"nPrev" : 1,
|
"ok" : 1
|
}
|
Expected err message: "E11001 duplicate key error index: test.x.$name_1 dup key: { : \"another\" }"