Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-02-2020 04:31 PM
For example, I delete:
MATCH (n) where n.channel = 'sports' DETACH DELETE n
Although it deletes all nodes and relationships of the 'n', the labels still shows up in the browser. It's annoying. How can I wipe out all traces of those nodes and relationships once they are deleted?
Solved! Go to Solution.
07-02-2020 11:43 PM
Hello @lingvisa
Your current Cypher request deletes all nodes and their relationships which have a property channel
equal to sports
. If you want to delete nodes more safely, you can try:
CALL apoc.periodic.iterate("MATCH (n) WHERE n.channel = 'sports' RETURN n", "DETACH DELETE n", {batchSize:1000, iterateList:true})
Now, if you still can see Labels, make sure you don't have nodes remanining and if it's not the case, you must check if there are constraints or indexes:
CALL db.indexes
You can drop an index like this (doc😞
DROP INDEX index_name
You can drop a constraint like this (doc😞
DROP CONSTRAINT constraint_name
Regards,
Cobra
07-02-2020 10:19 PM
I think they do get deleted unless you have some index on them
07-02-2020 11:43 PM
Hello @lingvisa
Your current Cypher request deletes all nodes and their relationships which have a property channel
equal to sports
. If you want to delete nodes more safely, you can try:
CALL apoc.periodic.iterate("MATCH (n) WHERE n.channel = 'sports' RETURN n", "DETACH DELETE n", {batchSize:1000, iterateList:true})
Now, if you still can see Labels, make sure you don't have nodes remanining and if it's not the case, you must check if there are constraints or indexes:
CALL db.indexes
You can drop an index like this (doc😞
DROP INDEX index_name
You can drop a constraint like this (doc😞
DROP CONSTRAINT constraint_name
Regards,
Cobra
All the sessions of the conference are now available online