I was wondering if this the correct way to make a trigger
CALL apoc.trigger.add(
'setCreatedProperty',
'UNWIND $createdNodes AS n SET n.created = timestamp()',
{phase: "afterAsync"}
)
Yesterday I accidentally noticed one of my test nodes does not have this created field.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โn โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโก
โ(:Person {created: 1740608142752,name: "p1"})โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ(:Person {name: "p2"}) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ(:Person {created: 1740608155923,name: "p3"})โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ(:Person {created: 1740608230117,name: "p4"})โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ(:Person {created: 1740608237464,name: "p5"})โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
There is a bit of disclaimer here, as I am also testing with adding nodes through a plugin. But I guess on the other hand that should not be allowed to mess up this trigger behaviour.