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

Don't return "ErrUnacknowledgedWrite" when using an unacknowledged write concern

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0
    • Affects Version/s: None
    • Component/s: CRUD
    • None
    • Major Change
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?

      The following methods will no longer return an ErrUnacknowledgedWrite sentinel error. Now users must check the `Acknowledged` bool on write operation result structs to determine if a write was acknowledged.

      DDL commands, such as dropping a collection, will not longer be able to check if the write is acknowledged.

      2. Would you like the user to see examples of the syntax and/or executable code and its output?

      NA

      3. Which versions of the driver/connector does this apply to?
      v2

      Show
      1. What would you like to communicate to the user about this feature? The following methods will no longer return an ErrUnacknowledgedWrite sentinel error. Now users must check the `Acknowledged` bool on write operation result structs to determine if a write was acknowledged. DDL commands, such as dropping a collection, will not longer be able to check if the write is acknowledged. 2. Would you like the user to see examples of the syntax and/or executable code and its output? NA 3. Which versions of the driver/connector does this apply to? v2

      Currently, the Go driver returns mongo.ErrUnacknowledgedWrite for any write operation performed with an unacknowledged write concern. That makes handling errors difficult because you have to explicitly check for and discard mongo.ErrUnacknowledgedWrite. Instead, we should just return a nil result and a nil error if everything worked (i.e. if there were no observed errors).

      Definition of done:

      • Remove mongo.ErrUnacknowledgedWrite.
      • Add an Acknowledged bool to all write result types (e.g. InsertOneResult, BulkWriteResult, etc) to indicate whether or not the result information is from an unacknowledged write.

            Assignee:
            preston.vasquez@mongodb.com Preston Vasquez
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: