[2019/03/05 13:59:46.586] ********************************************************************** [2019/03/05 13:59:46.586] File "examples/bulk.rst", line 95, in default [2019/03/05 13:59:46.586] Failed example: [2019/03/05 13:59:46.586] try: [2019/03/05 13:59:46.586] db.test.bulk_write(requests) [2019/03/05 13:59:46.586] except BulkWriteError as bwe: [2019/03/05 13:59:46.586] pprint(bwe.details) [2019/03/05 13:59:46.586] Expected: [2019/03/05 13:59:46.586] {'nInserted': 0, [2019/03/05 13:59:46.586] 'nMatched': 1, [2019/03/05 13:59:46.586] 'nModified': 1, [2019/03/05 13:59:46.586] 'nRemoved': 0, [2019/03/05 13:59:46.586] 'nUpserted': 0, [2019/03/05 13:59:46.586] 'upserted': [], [2019/03/05 13:59:46.586] 'writeConcernErrors': [], [2019/03/05 13:59:46.586] 'writeErrors': [{'code': 11000, [2019/03/05 13:59:46.586] 'errmsg': '...E11000...duplicate key error...', [2019/03/05 13:59:46.586] 'index': 1, [2019/03/05 13:59:46.586] 'op': {'_id': 4}}]} [2019/03/05 13:59:46.586] Got: [2019/03/05 13:59:46.586] {'nInserted': 0, [2019/03/05 13:59:46.586] 'nMatched': 1, [2019/03/05 13:59:46.586] 'nModified': 1, [2019/03/05 13:59:46.586] 'nRemoved': 0, [2019/03/05 13:59:46.586] 'nUpserted': 0, [2019/03/05 13:59:46.586] 'upserted': [], [2019/03/05 13:59:46.586] 'writeConcernErrors': [], [2019/03/05 13:59:46.586] 'writeErrors': [{'code': 11000, [2019/03/05 13:59:46.586] 'errmsg': 'E11000 duplicate key error collection: ' [2019/03/05 13:59:46.586] 'bulk_example.test index: _id_ dup key: { _id: ' [2019/03/05 13:59:46.586] '4 }', [2019/03/05 13:59:46.586] 'index': 1, [2019/03/05 13:59:46.586] 'keyPattern': {'_id': 1}, [2019/03/05 13:59:46.586] 'keyValue': {'': 4}, [2019/03/05 13:59:46.586] 'op': {'_id': 4}}]} [2019/03/05 13:59:46.598] ********************************************************************** [2019/03/05 13:59:46.598] File "examples/bulk.rst", line 133, in default [2019/03/05 13:59:46.598] Failed example: [2019/03/05 13:59:46.598] try: [2019/03/05 13:59:46.598] db.test.bulk_write(requests, ordered=False) [2019/03/05 13:59:46.598] except BulkWriteError as bwe: [2019/03/05 13:59:46.598] pprint(bwe.details) [2019/03/05 13:59:46.598] Expected: [2019/03/05 13:59:46.598] {'nInserted': 0, [2019/03/05 13:59:46.598] 'nMatched': 1, [2019/03/05 13:59:46.598] 'nModified': 1, [2019/03/05 13:59:46.598] 'nRemoved': 1, [2019/03/05 13:59:46.598] 'nUpserted': 0, [2019/03/05 13:59:46.598] 'upserted': [], [2019/03/05 13:59:46.598] 'writeConcernErrors': [], [2019/03/05 13:59:46.598] 'writeErrors': [{'code': 11000, [2019/03/05 13:59:46.598] 'errmsg': '...E11000...duplicate key error...', [2019/03/05 13:59:46.598] 'index': 0, [2019/03/05 13:59:46.598] 'op': {'_id': 1}}, [2019/03/05 13:59:46.598] {'code': 11000, [2019/03/05 13:59:46.598] 'errmsg': '...E11000...duplicate key error...', [2019/03/05 13:59:46.598] 'index': 2, [2019/03/05 13:59:46.598] 'op': {'_id': 3}}]} [2019/03/05 13:59:46.598] Got: [2019/03/05 13:59:46.598] {'nInserted': 0, [2019/03/05 13:59:46.598] 'nMatched': 1, [2019/03/05 13:59:46.598] 'nModified': 1, [2019/03/05 13:59:46.598] 'nRemoved': 1, [2019/03/05 13:59:46.598] 'nUpserted': 0, [2019/03/05 13:59:46.598] 'upserted': [], [2019/03/05 13:59:46.598] 'writeConcernErrors': [], [2019/03/05 13:59:46.598] 'writeErrors': [{'code': 11000, [2019/03/05 13:59:46.598] 'errmsg': 'E11000 duplicate key error collection: ' [2019/03/05 13:59:46.598] 'bulk_example.test index: _id_ dup key: { _id: ' [2019/03/05 13:59:46.598] '1 }', [2019/03/05 13:59:46.598] 'index': 0, [2019/03/05 13:59:46.598] 'keyPattern': {'_id': 1}, [2019/03/05 13:59:46.598] 'keyValue': {'': 1}, [2019/03/05 13:59:46.598] 'op': {'_id': 1}}, [2019/03/05 13:59:46.598] {'code': 11000, [2019/03/05 13:59:46.598] 'errmsg': 'E11000 duplicate key error collection: ' [2019/03/05 13:59:46.598] 'bulk_example.test index: _id_ dup key: { _id: ' [2019/03/05 13:59:46.598] '3 }', [2019/03/05 13:59:46.598] 'index': 2, [2019/03/05 13:59:46.598] 'keyPattern': {'_id': 1}, [2019/03/05 13:59:46.598] 'keyValue': {'': 3}, [2019/03/05 13:59:46.598] 'op': {'_id': 3}}]}
- is caused by
-
SERVER-14801 duplicate key error should report field names as well as values
- Closed