Hi guys, i'm new to neo4j and cypher.
I want to delete a category that's not used anymore from the database. See the image below:
How do I do it? I tried the
MATCH (c:Category {name: 'neo4j_SWITCH.csv'})
DELETE c;
and I got No changes, no records
as a result. But the node category is still showing over there...
Thanks in advance
That looks like a label:
MATCH (n)
WHERE EXISTS(n:`neo4j_SWITCH.csv`)
REMOVE n:`neo4j_SWITCH.csv`;
Hi, those are indeed Labels on the nodes like Josh said.
And sadly I don't believe we have any method of 'removing' a label from the database, only removing all usages of it. Once it's been added to the group of existing labels it stays around even without any usages.
I thought that the browser/query page would filter out unused labels from that side panel list but maybe they don't? Or you still have some node with the label even if your screenshot seem to indicate differently.
Sorry for not being able to help,
Therese
@brenokastrup
one reason why they may still appear is because you have a index / constraint against said label.
if you run cypher
show indexes;
show constraints;
do you see a index or constraint defined against the label
Hi everybody, thanks for all the inputs.
I found a solution from another post. I had no nodes using the Label, but there were still indexes and constraints.
So all i had to do was to get rid of them using the code
CALL apoc.schema.assert({}, {}, true);