diff --git a/src/Database/Database.php b/src/Database/Database.php index d4e2dc151..3f086360a 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -3425,13 +3425,9 @@ public function createDocuments(string $collection, array $documents, int $batch } $documents[$key] = $this->decode($collection, $document); + $this->trigger(self::EVENT_DOCUMENT_CREATE, $documents[$key]); } - $this->trigger(self::EVENT_DOCUMENTS_CREATE, new Document([ - '$collection' => $collection->getId(), - 'modified' => array_map(fn ($document) => $document->getId(), $documents) - ])); - return $documents; } diff --git a/tests/e2e/Adapter/Base.php b/tests/e2e/Adapter/Base.php index ea18ea2a7..5a141718e 100644 --- a/tests/e2e/Adapter/Base.php +++ b/tests/e2e/Adapter/Base.php @@ -17036,7 +17036,8 @@ public function testEvents(): void Database::EVENT_DOCUMENT_SUM, Database::EVENT_DOCUMENT_INCREASE, Database::EVENT_DOCUMENT_DECREASE, - Database::EVENT_DOCUMENTS_CREATE, + Database::EVENT_DOCUMENT_CREATE, + Database::EVENT_DOCUMENT_CREATE, Database::EVENT_DOCUMENT_UPDATE, Database::EVENT_DOCUMENT_UPDATE, Database::EVENT_DOCUMENT_UPDATE,