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(