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

DeleteMany not working as expected

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 0.3.0
    • Component/s: API, BSON, Documentation
    • None
    • Environment:
      Mac OS

      Using DeleteMany with more than one bson.D always generates an error.

      In the examples, it's possible to find a DeleteMany example but it actually deletes only one bson.D:

       

      result, err := coll.DeleteMany(context.Background(),			       bson.D{{"status", "A"},},)

       But what if I want to delete more documents?

      I tried with:

      []interface{}{ bson.D{"_id" : "someId"}, bson.D{"_id" : "someOtherId"} }

      But I got: cannot transform type []interface{} to a *bsonx.Document

      And even with:

      []bson.D{ bson.D{"_id" : "someId"}, bson.D{"_id" : "someOtherId"} }

       

      But I got*: cannot transform type []primitive.D to a bsonx.Document

       
      I feel like it's also needed a proper example & the API of this method should be similar to InsertMany.

       

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            andream16 Andrea Medda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: