diff --git a/src/Database/Database.php b/src/Database/Database.php index 512a6d828..59871c6db 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -6799,12 +6799,16 @@ public function purgeCachedCollection(string $collectionId): bool * And related document reference in the collection cache. * * @param string $collectionId - * @param string $id + * @param string|null $id * @return bool * @throws Exception */ - public function purgeCachedDocument(string $collectionId, string $id): bool + public function purgeCachedDocument(string $collectionId, ?string $id): bool { + if ($id === null) { + return true; + } + [$collectionKey, $documentKey] = $this->getCacheKeys($collectionId, $id); $this->cache->purge($collectionKey, $documentKey);