IndexView.CreateMany should wrap driver.ErrUnacknowledgedWrite

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 1.8.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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().

              Assignee:
              Matt Dale
              Reporter:
              Reilly Watson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: