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

IndexView.CreateMany should wrap driver.ErrUnacknowledgedWrite

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Unknown Unknown
    • 1.8.1
    • None
    • None
    • None

    Description

      If I create an index like so:

      iv := db.Collection("foo", options.Collection().SetWriteConcern(writeconcern.New(writeconcern.W(0)))).Indexes()
      _, err := iv.CreateOne(context.TODO(), mongo.IndexModel{Keys: bson.D{{Key: "user_id", Value: 1}}})
      

      I get back the error go.mongodb.org/mongo-driver/x/mongo/driver.ErrUnacknowledgedWrite. This should presumably be mongo.ErrUnacknowledgedWrite! Other operations that return this call processWriteErr() to transform it, but it's missing from IndexView.CreateMany().

      Attachments

        Activity

          People

            matt.dale@mongodb.com Matt Dale
            rwatson@league.com Reilly Watson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: