Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4317

Create codeName property for insertOne

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Not Needed

      How are you using Mongo? What version of the server and driver are you using?

      Latest version

      What is the feature/improvement you would like?

       

      When I update a document that violates unique index in a collection, I get an error with codeName: 'DuplicateKey'. But when I insert a document that violates unique index in a collection, I just get an error with code 11000. I would like to also see there codeName 'DuplicateKey' in error object.

      What use case would this feature/improvement enable?

       

      It would improve readability of error handling in the code and also help to distinguish this kind of error from others.

            Assignee:
            Unassigned Unassigned
            Reporter:
            guseyn@guseyn.com Guseyn Ismayylov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: