You can implement a [TransactionEventHandler][1]
that performs the enforcing your constraints and register it with your GraphDatabaseService instance. A TransactionEventHandler
can inspect the contents of the current transaction and eventually veto on committing, see http://docs.neo4j.org/chunked/stable/transactions-events.html.
how to prevent a neo4j graph to have relationship with itself?
-
30-07-2022 - |
質問
1.How should I prevent nodes to have relationships with themselves in neo4j graph?
2.How should I force nodes to have only one relationship with each other,I mean if node A have relationship with node B this way: A--->B, there should not be any B--->A?
I know in graph making everything is on my own so I can handle both of them,but consider there is a java api which user says which nodes and relationships should be created,but I want to prevent user from 1 and 2?
Is there any possibility in neo4j for handling them?
解決
所属していません StackOverflow