When trying to enter a new document in mongo with a value on a field that already exist in another document i get this when i iterate through the error object:
for(var att in err){
console.log(att+": "+err[att]);
}
name: MongoError err: E11000 duplicate key error index: draw.users.$email_1 dup key: { : "[email protected]" } code: 11000 n: 0 ok: 1
So it tells me what i want to know, the problem is the email field. But can I get the offending field as a key/value rather than just a string?