[GODRIVER-1420] supporting of ReturnDocument in BulkWriteOptions when doing bulk operation Created: 30/Nov/19  Updated: 11/Dec/19  Resolved: 11/Dec/19

Status: Closed
Project: Go Driver
Component/s: API, CRUD
Affects Version/s: 1.1.3
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: DHARMADEV gupta Assignee: Isabella Siu (Inactive)
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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)



 Comments   
Comment by Isabella Siu (Inactive) [ 11/Dec/19 ]

Hi dharmadev2@gmail.com,

No, the answer is that if the database ever adds this functionality we will, but we cannot at this point. I should have closed this instead of putting it in waiting for reporter.

Comment by DHARMADEV gupta [ 11/Dec/19 ]

Is there anything needed from my side.Please let me know.

Generated at Thu Feb 08 08:36:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.