Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j, Cypher: How to update a property name?

Tags:

neo4j

cypher

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?

like image 338
Francisco Gutiérrez Avatar asked Apr 02 '14 19:04

Francisco Gutiérrez


2 Answers

You can change your old column name by using following query

MATCH (n:term)
SET n.name = n.myproperty
REMOVE n.myproperty
RETURN n
like image 164
Sadikhasan Avatar answered Oct 07 '22 23:10

Sadikhasan


Solved by myself, heres what I did:

MATCH (n:term)
SET n.name = n.label
REMOVE n.label
RETURN n
like image 41
Francisco Gutiérrez Avatar answered Oct 07 '22 22:10

Francisco Gutiérrez