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)