File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -4975,9 +4975,12 @@ public function createOrUpdateDocumentsWithIncrease(
49754975 $ document
49764976 ->setAttribute ('$id ' , empty ($ document ->getId ()) ? ID ::unique () : $ document ->getId ())
49774977 ->setAttribute ('$collection ' , $ collection ->getId ())
4978- ->setAttribute ('$createdAt ' , empty ($ createdAt ) || !$ this ->preserveDates ? $ time : $ createdAt )
49794978 ->setAttribute ('$updatedAt ' , empty ($ updatedAt ) || !$ this ->preserveDates ? $ time : $ updatedAt );
49804979
4980+ if ($ old ->isEmpty ()) {
4981+ $ document ->setAttribute ('$createdAt ' , empty ($ createdAt ) || !$ this ->preserveDates ? $ time : $ createdAt );
4982+ }
4983+
49814984 if (!$ updatesPermissions ) {
49824985 $ document ->setAttribute ('$permissions ' , $ old ->getPermissions ());
49834986 }
You can’t perform that action at this time.
0 commit comments