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

supporting of ReturnDocument in BulkWriteOptions when doing bulk operation

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • 1.1.3
    • API, CRUD
    • None

    Description

      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)

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: