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

supporting of ReturnDocument in BulkWriteOptions when doing bulk operation

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.1.3
    • Component/s: API, CRUD
    • None

      when we are making db API call for set of Document to update at once in bulk write API. Then can we pass one flag  for returning new Document when update done.

      BulkWriteOptions.returnDocument

       

      for _, msg := range listOfData

      { operation := mongo.NewUpdateOneModel() operation.SetFilter(bson.M\{"_id": msgbyte.Id}

      )
      operation.SetUpdate(bson.M{"$set": bson.M{}})
      operation.SetUpsert(false)
      operations = append(operations, operation)
      }

      bulkOption := options.BulkWriteOptions{}

      BulkWriteOptions.returnDocument

      bulkWriteResponse,err:=t.collection(ctx,operations,bulkOption)

            Assignee:
            isabella.siu@mongodb.com Isabella Siu (Inactive)
            Reporter:
            dharmadev2@gmail.com DHARMADEV gupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: