How to change/update a label in Neo4j - Cypher?

cypher, neo4j

Solution

You can do that using `REMOVE` on the `Book` label and `SET` on the new label:

MATCH (p:Person)-[r]-(b:Book {id: id1})
REMOVE b:Book
SET b:DeletedBook
RETURN b

You should check out the Neo4j Cypher Refcard for a complete reference to Cypher 2.x.

Problem

Is it possible to change a label on a node using Cypher? I have a node with label `Book`, as shown below. I want to change the `Book` label to `DeletedBook`. ``` (u:Person)-[r]-(b:Book{id:id1}) (u:Person)-[r]-(b:DeletedBook{id:id1}) ```

Original source