Badmiral
Badmiral

Reputation: 1589

neo4j movie example, change all node titles to node names

I have a bunch of actors and movies in my database. The movies have titles and I want to convert all the properties that have title as their property name to be "name". Would like to do this via cypher. Thanks!

Upvotes: 0

Views: 211

Answers (1)

Michael Hunger
Michael Hunger

Reputation: 41706

start n=node(*)
where has(n.title)
set n.name = n.title
delete n.title
return count(*);

Upvotes: 3

Related Questions