Uploaded image for project: 'PHP ORMs'
  1. PHP ORMs
  2. PHPORM-171

createOrFirst does not set timestamp fields

    • PHP Drivers

      https://github.com/mongodb/laravel-mongodb/issues/2720#issuecomment-2071709454

      After updating to 4.2.0 we were happy to see that transactions are working fine,

      Unfortunately "created_at" and "updated_at" fields are no longer automatically inserted in new records using firstOrCreate, createOrFirst, updateOrCreate, ...

      This code creates new record with "created_at" and "updated_at" fields :
      $obj = new \App\Models\Parameter; // instantiate model
      $obj->created_by = 'nico';
      $obj->save();
       
      It breaks between 4.1.3 and 4.2.0

      Regards.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: