You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!$check->match($existingDoc, (string)$existingDocId)) {
384
+
continue;
385
+
}
386
+
387
+
if ((string)$existingDocId === $docId) {
388
+
continue;
389
+
}
383
390
384
-
foreach ($existingDocsas$existingDoc) {
385
391
thrownewRuntimeException(
386
392
$errMsg ?? "Unique constraint violation. Cannot insert or update document with id $docId, because a document with same value for field: {$index->field()} exists already!"
387
393
);
@@ -434,9 +440,15 @@ private function assertMultiFieldUniqueConstraint(string $collectionName, string
if (!$checkList->match($existingDoc, (string)$existingDocId)) {
445
+
continue;
446
+
}
447
+
448
+
if ((string)$existingDocId === $docId) {
449
+
continue;
450
+
}
438
451
439
-
foreach ($existingDocsas$existingDoc) {
440
452
$fieldNamesStr = implode(", ", $fieldNames);
441
453
thrownewRuntimeException(
442
454
$errMsg ?? "Unique constraint violation. Cannot insert or update document with id $docId, because a document with same values for fields: {$fieldNamesStr} exists already!"
0 commit comments