-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.0.2
-
Component/s: Index Maintenance
-
None
-
(copied to CRM)
The current output is like this:
{"err"=>"E11000 duplicate key error index: ruby-test-db.test.$foo_1 dup key: { : 3 }", "code": 11000, "n": 0, "connectionId": 58, "ok": 1.0}
Three problems:
1. The duplicate key is specified as part of a string.
2. Only the latest duplicate key is given. On a bulk insert with continue_on_error, we should get a list containing all duplicate keys found.
3. If we're given only the duplicate keys, it's hard to be sure which documents were inserted. For that, we also need the _ids of the documents that were rejected.
Here's the ideal output:
{"err"=>"E11000 duplicate key error index: ruby-test-db.test.$foo_1 dup keys: [3, 4]",
"keys": [3, 4], rejected_ids: [ObjectId("4f071fbe935f46ab13686625"), ObjectId("4f071fbe935f46ab13686627")],
"code": 11000, "n": 0, "connectionId": 58, "ok": 1.0
}
- is depended on by
-
RUBY-356 Bulk insert with :continue_on_error returns ids that were not written to collection
- Closed
- is related to
-
SERVER-19281 Add index name as a separate field on duplicate key error object
- Closed
-
SERVER-14801 duplicate key error should report field names as well as values
- Closed