Hello,
I would like to check if a graph projection exists and if yes, drop it.
Here is the code tried without success:
</>CALL gds.graph.list()
YIELD graphName
WITH graphName AS graph
CALL gds.graph.drop(graph)
YIELD graphName
RETURN graphName</>
Neo4j Kernel:4.4.2:enterprise
gdsVersion:1.8.2
neo4jVersion:4.4.2
Thank you for your help.
Julie
cobra
(Cobra)
April 28, 2022, 3:31pm
2
Hello @julie.cavarroc and welcome to the Neo4j community
You could use directly (doc ):
CALL gds.graph.drop('your-graph-name', false) YIELD graphName;
If you want to drop all graph projections:
CALL gds.graph.list()
YIELD graphName
WITH graphName AS g
CALL gds.graph.drop(g, false)
YIELD graphName
RETURN graphName
Regards,
Cobra
Thank you for your answer.
It is for an automatic use. So I need:
Check if the graph projection exists,
If it exists, get the name and drop it by the command you suggest
Regards,
Julie
cobra
(Cobra)
April 28, 2022, 3:46pm
4
The query I sent you do the both at the time. It will delete the graph if it exists.
cobra
(Cobra)
April 30, 2022, 7:58am
5
Hello @julie.cavarroc , did you need more help?