Update an Actor's size category along with the dimensions of that Actor's related TokenDocuments across multiple Scenes.
foundry.documents.modifyBatch([
{
action: "update",
documentName: "Actor",
updates: [{_id: "Ay52yVxCgusBct1b", "system.size": "big"}],
},
{
action: "update",
documentName: "TokenDocument",
updates: [{_id: "30pnHJciHu4CvPnz", width: 2, height: 2}],
parent: sceneA
},
{
action: "update",
documentName: "TokenDocument",
updates: [{_id: "knSU5NQVXeIQQeHi", width: 2, height: 2}],
parent: sceneB
}
]);
Bundle multiple Document-modification operations into a single, batched request. The modifications are made in sequence without a network delay between each. This can be useful when, for example, it is desirable that there not be an unpredictable delay between operations due to latency. For certain operations there may also be a need to ensure there will never be a mixed state: either all must succeed, or all must fail. batch succeed or otherwise that all fail.
The nature of batched modifications does have some limitations: