Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2939

Clarify IsDuplicateKeyError()'s docs

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Unknown Unknown
    • 2.0.0
    • None
    • None
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      func IsDuplicateKeyError(err error) bool
          IsDuplicateKeyError returns true if err is a duplicate key error
      

      This doesn't answer the question of what happens in the case of "hybrid" WriteException errors (e.g., a dupe-key plus some other WriteError).

      It would be good for this function to clarify. (Based on the present implementation, as long as there is >=1 dupe-key error, the function returns true.)

      Aside: In driver v2 "HasDuplicateKeyEerror" might be a better name?

      Attachments

        Activity

          People

            matt.dale@mongodb.com Matt Dale
            felipe.gasper@mongodb.com Felipe Gasper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: