From d6544f412de4742e341afdbbe4e5cb0d0be63a02 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 15 Aug 2025 00:36:26 +1200 Subject: [PATCH] Add missing bulk cases on commit --- .../Databases/Http/Transactions/Update.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Transactions/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Transactions/Update.php index d7da3c0df5..0240f3e9f6 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Transactions/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Transactions/Update.php @@ -152,14 +152,30 @@ class Update extends Action min: $data['min'] ?? null ); break; - + + case 'bulkCreate': + $documents = []; + foreach ($data as $docData) { + $documents[] = new Document($docData); + } + $dbForProject->createDocuments($collectionId, $documents); + break; + case 'bulkUpdate': $dbForProject->updateDocuments( - $collectionName, + $collectionId, $data['data'] ?? null, $data['queries'] ?? [] ); break; + + case 'bulkUpsert': + $documents = []; + foreach ($data as $docData) { + $documents[] = new Document($docData); + } + $dbForProject->createOrUpdateDocuments($collectionId, $documents); + break; case 'bulkDelete': $dbForProject->deleteDocuments(