Add missing bulk cases on commit

This commit is contained in:
Jake Barnby 2025-08-15 00:36:26 +12:00
parent 3a7d8d2296
commit d6544f412d
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -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,