On top of adding, updating, and deleting properties, we can do the same with node labels. If you need to add a label to an existing node, you can use the following syntax:
MATCH (n {id: 1})
SET n:AnotherLabel
RETURN labels(n)
Here, again, the RETURN statement is just there to make sure everything went well. The result is as follows:
["Label", "AnotherLabel"]
On the contrary, if you mistakenly set a label to a node, you can REMOVE it:
MATCH (n {id: 1})
REMOVE n:AnotherLabel
RETURN labels(n)
And we are back to the situation where the node with id:1 has a single label called Label.