12
votes

I have a set of nodes with a property, myproperty = "James" I want to update that property from (myproperty) to (name).

Is there any way to this with Cypher?

3

3 Answers

16
votes

Solved by myself, heres what I did:

MATCH (n:term)
SET n.name = n.label
REMOVE n.label
RETURN n
1
votes
match (a:employee {empid:123,location:1}) 
set a.newlabel=a.removelabel 
remove a.removelabel 
return a;
0
votes

You can change your old column name by using following query

MATCH (n:term)
SET n.name = n.myproperty
REMOVE n.myproperty
RETURN n