修改节点标签和关系类型

 

Here’s the table of contents:

  1. 修改节点标签
  2. 修改边类型

修改节点标签

//Set a label on a node
MATCH (n {name: 'Stefan'})
SET n:German
RETURN n.name, labels(n) AS labels
//Set multiple labels on a node
MATCH (n {name: 'George'})
SET n:Swedish:Bossman
RETURN n.name, labels(n) AS labels

修改边类型

//改变关系类型/名称,关系现有属性不受影响
MATCH p=()-[r:ACTED_IN]->() WHERE ID(r)=2864109 WITH r
CALL apoc.refactor.setType(r,'ACTED_IN_REFACTOR')
YIELD input,output
RETURN input,output