How can I add a label to an existing node using a Cypher query?
The property mutation operator += can be used with SET to mutate properties from a map in a fine-grained fashion: Any properties in the map that are not on the node or relationship will be added.
You can change the nodes associated with a label but you can't change the type of a relationship.
In this scenario, we are going to use two existing nodes : CreditCard and Customer to create a Relationship with properties. That means, our Neo4J Database should have these two nodes. We use CQL MATCH command to retrieve existing two nodes and CQL CREATE command to create new Relationship between them.
That's in the reference docs, see http://docs.neo4j.org/chunked/stable/query-set.html#set-set-a-label-on-a-node, you need to use set
to a add a label to a existing node:
match (n {id:desired-id}) set n :newLabel return n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With