mongoid_denormalize icon indicating copy to clipboard operation
mongoid_denormalize copied to clipboard

Updating associated records saves each record individually

Open brendanstennett opened this issue 10 years ago • 0 comments

It seems each records gets updated and saved individually rather than using update_all. Using the current method to update each record is slow and any failure (possibly due to transient database connectivity problems) will effect the integrity of the denormalized data.

I propose switching using update_all which is much faster and only requires 1 query to update all documents, lowering the possibility of the update failing.

Any objects to this?

brendanstennett avatar Jul 23 '15 12:07 brendanstennett