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.