Skip to content

Commit 8043176

Browse files
authored
Merge pull request #575 from utopia-php/feat-upsert-ignore
Skip documents without changes
2 parents cd55117 + 6394dc6 commit 8043176

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Database/Database.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4731,6 +4731,12 @@ public function createOrUpdateDocumentsWithIncrease(
47314731
)));
47324732
}
47334733

4734+
$disallowed = ['$tenant', '$internalId'];
4735+
if ($old->getArrayCopy(disallow: $disallowed) == $document->getArrayCopy(disallow: $disallowed)) {
4736+
unset($documents[$key]);
4737+
continue;
4738+
}
4739+
47344740
// If old is empty, check if user has create permission on the collection
47354741
// If old is not empty, check if user has update permission on the collection
47364742
// If old is not empty AND documentSecurity is enabled, check if user has update permission on the collection or document

0 commit comments

Comments
 (0)