You can use triggers with apoc, that check e.g. when a node with label
:Yellow is added:
CALL apoc.trigger.add('create-new-yellow-node','
UNWIND apoc.trigger.nodesByLabel({createdNodes},'Yellow') AS this
MATCH (this)<-[:CHILD_OF*]-(p) WHERE p.value = this.value *SET ...*
', {phase:'before'})
Mich
- *Neo4j version*: 3.3.1 Enterprise
- *Driver*: Javascript-driver
- *Used Language*: Typescript / Angular 2
- *OS*: Windows 10
I have a series of nodes with RED being the Root-node, and YELLOW is always
the parent of ONLY a green node (GREEN always the child of ONLY YELLOW).