I'm connecting to the server via bolt. I need to delete all nodes and relations then create a new graph.
Once I run
with driver.session() as session:
session.run("""CALL apoc.periodic.iterate('MATCH (n) RETURN n', 'DETACH DELETE n', {batchSize:10, parallel:false})""")
Or
result = session.run("""CALL apoc.periodic.commit('MATCH(s) WITH s LIMIT $num DETACH DELETE s RETURN count(*) AS c', {num: 1000})""")
Or
session.run("MATCH (n) DETACH DELETE n")
Then all nodes and relations are deleted, which is right. However, when I run the script again (after creating new nodes and relations), then the query is hung and I have to restart the server so the script is workin.
What is the problem here?
I'm using the latest version of neo4j and I'm facing this issue from different previous versions.