Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change node label in neo4j

Tags:

neo4j

cypher

I have created a node with a wrong label.
Is there any way to change node label or relationship type without re-creating it? I have tried something like

MATCH n WHERE Id(n)=14 SET n.Labels = 'Person'

but it is fault...

like image 762
tsdaemon Avatar asked Aug 31 '25 22:08

tsdaemon


1 Answers

MATCH (n:OLD_LABEL {id:14})
REMOVE n:OLD_LABEL
SET n:NEW_LABEL

Guess this query explains itself.

like image 94
tstorms Avatar answered Sep 04 '25 21:09

tstorms