globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 232 forks source link

Clean actions attribute of Bulk struct #384

Open GonzMG opened 4 years ago

GonzMG commented 4 years ago

I'm using (b *Bulk) Update(pairs ...interface{}) to modify a huge quantity of data in a collection. To avoid memory errors, I'm using batches to perform thebulk.Run().

The problem I've found is the bulk class does not clean the the array of actions actions []bulkAction. Should we add a method to clean this variable or in the Run() function set the array as empty?

Thanks in advance!