2

I would like to be able to save multiple records at once. What is the best way of doing this? I can of course iterate over my records and use the save function for each one. However, this is not very good for performance. The other option I can think of is to create my own database query using the insertAll command. This would be better for performance.

Is there any built in function to batch save multiple records at once or is the insertAll alternative the way to go?

Thanks for your time.

1 Answer 1

2

You could use a task within your plugin for better performance when looping through your records.

Check the TasksService docs and also PowerNap, an example plugin that uses a task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.