Batch API (CloudCode)
// Without batch
await obj1.save();
await obj2.save();
await obj3.destroy();
// Doing the same with DB.Batch:
var batch = new DB.Batch();
// These operations only add the objects to the batch, but does not perform any actions on the server yet.
batch.save(obj1);
batch.save(obj2);
batch.destroy(obj3);
// This executes all operations in the batch in a single network request.
await batch.execute();Large batches
Error handling
Last updated