diff --git a/src/Database/Database.php b/src/Database/Database.php index ffb495884..94716b7d7 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -4731,6 +4731,12 @@ public function createOrUpdateDocumentsWithIncrease( ))); } + $disallowed = ['$tenant', '$internalId']; + if ($old->getArrayCopy(disallow: $disallowed) == $document->getArrayCopy(disallow: $disallowed)) { + unset($documents[$key]); + continue; + } + // If old is empty, check if user has create permission on the collection // If old is not empty, check if user has update permission on the collection // If old is not empty AND documentSecurity is enabled, check if user has update permission on the collection or document