Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-09-2019 07:11 AM
Hello,
I am using an apoc trigger to automatically add a property to all newly created nodes.
call apoc.trigger.add('add_property', "unwind {createdNodes} as node match(node) set node.auto = 'property'", { phase: 'before' })
When I execute the following cypher query, I was expecting that the returned node already contain the 'auto' property.
CREATE(node : MYNODE { name : 'node1'}) RETURN node
But instead, I need to reload it to see the 'auto' property.
match(node : MYNODE { name : 'node1'}) RETURN node
Is this the normal behavior ? Is this possible to create a trigger that directly modify the returned node during the creation ?
Thanks for your help
Vincent
neo4j 3.3.2
apoc 3.3.0.3
Solved! Go to Solution.
08-10-2019 02:02 AM
That's expected behaviour. When the transaction is about to be committed (the before
phase) the results of your statement are already produced, so you won't see trigger modifications at that time.
08-10-2019 02:02 AM
That's expected behaviour. When the transaction is about to be committed (the before
phase) the results of your statement are already produced, so you won't see trigger modifications at that time.
All the sessions of the conference are now available online