mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Add missing bulk cases on commit
This commit is contained in:
parent
3a7d8d2296
commit
d6544f412d
1 changed files with 18 additions and 2 deletions
|
|
@ -153,14 +153,30 @@ class Update extends Action
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'bulkCreate':
|
||||||
|
$documents = [];
|
||||||
|
foreach ($data as $docData) {
|
||||||
|
$documents[] = new Document($docData);
|
||||||
|
}
|
||||||
|
$dbForProject->createDocuments($collectionId, $documents);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'bulkUpdate':
|
case 'bulkUpdate':
|
||||||
$dbForProject->updateDocuments(
|
$dbForProject->updateDocuments(
|
||||||
$collectionName,
|
$collectionId,
|
||||||
$data['data'] ?? null,
|
$data['data'] ?? null,
|
||||||
$data['queries'] ?? []
|
$data['queries'] ?? []
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'bulkUpsert':
|
||||||
|
$documents = [];
|
||||||
|
foreach ($data as $docData) {
|
||||||
|
$documents[] = new Document($docData);
|
||||||
|
}
|
||||||
|
$dbForProject->createOrUpdateDocuments($collectionId, $documents);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'bulkDelete':
|
case 'bulkDelete':
|
||||||
$dbForProject->deleteDocuments(
|
$dbForProject->deleteDocuments(
|
||||||
$collectionName,
|
$collectionName,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue