How can I create a TRIGGER?

Hello! I just started using Neo4j.

I have a little pokemon database which I just created. Now I'd like to have a java or python code where I can define a Trigger (I guess I have to do this in external code, not with Cypher in the server browser)

image

My idea is that now, every time a new pokemon is added, the code should be checking the type of such pokemon, identify the type he is effective against, and making the relationship between that new node and the rest of the Pokemon. Is this achievable in any way? Thanks!

1 Like

Use APOC -- it supports definition of triggers. Here are the docs.

https://neo4j-contrib.github.io/neo4j-apoc-procedures/#triggers

1 Like

Thanks a lot! have a good day :slight_smile:

1 Like