MongoError additional information

Tag: mongodb Author: qq365661523 Date: 2013-12-28

I'm interested by Mongo Errors, the only useful link I found is not that useful actually.

"name": "MongoError",
"err": "E11000 duplicate key error index: AyolanDB.users.$email_1  dup key: { : \"[email protected]\" }",
"code": 11000,
"n": 0,
"connectionId": 838,
"ok": 1

For example, what does mean the "ok"? That the DB is still running? What's "n"?

If anyone has more information about that... Because it's quite poor actually!

Best Answer

ok - means a command successfully completed

n - number of document affected (insert | update | remove)

For more info, see getLastError