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

Clarify IsDuplicateKeyError()'s docs

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: 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?

      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?

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

              Created:
              Updated:
              Resolved: