[DOCS-12910] Investigate changes in SERVER-19281: Add index name as a separate field on duplicate key error object Created: 24/Jul/19  Updated: 13/Nov/23  Resolved: 23/Mar/20

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 4.3.1, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: docs-grab-bag
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-19281 Add index name as a separate field on... Closed
Participants:
Days since reply: 3 years, 46 weeks, 2 days ago
Epic Link: DOCS: 4.4 Server Release Work

 Description   

Description

SERVER ticket description: This issue is very similar to SERVER-5053, but focusing on the index field, not the duplicate keys.

In other words, I'm not really so much interested in

"key": { "_id" : ObjectId('4e683574bc4135eee514713f') }

as I am in

"index" : "test.people.$_id_"

or better yet, fields like these:

"ns": "test.people"
"index" : "_id_"

SERVER-5053 got closed as a duplicate of SERVER-4637 which doesn't even mention the index field, but suggests adding the keys as well as the _ids, which in turn resulted in some ambiguity on how to solve some problems that came up and the issue has been stalled since 2012.

So, without getting bogged down by issues related to keys and _ids, would it be possible to just add the index name to the error object first and then figure out the rest later?

I find nearly all of MongoDB's design and interfaces very elegant and pleasant to work with, but this is a major exception among the most common use cases. The duplicate key error message parsing is the messiest part of the Mongo interface in many applications.

So this (hopefully simple) change would be a lot of help to many developers struggling with this problem.
Change Description: The getLastError object now has two new fields.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 23/Mar/20 ]

Author:

{'email': 'kay.kim@10gen.com', 'name': 'Kay Kim', 'username': 'kay-kim'}

Message: DOCS-12910: 4.4 GLE and duplicate key error return fields
Branch: master
https://github.com/mongodb/docs/commit/d8f714de6a7369eef8b25498f770312444c07838

Generated at Thu Feb 08 08:06:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.