简体   繁体   English

如何在cypher neo4j中更新或更改值

[英]How to Update or change value in cypher neo4j

Is there any update query in cypher using which we can update the property of any node or relationship ? 在cypher中是否有任何更新查询,我们可以使用它来更新任何节点或关系的属性?
For eg I have following node and relationship: 例如,我有以下节点和关系:
NodeA -[r:relatedTo]- NodeB NodeA - [r:relatedTo] - NodeB
where relatedTo is a relationship having properties like active or inactive 其中relatedTo是具有活动或非活动属性的关系

How can I change this property using cypher query ? 如何使用cypher查询更改此属性?

using SET keyword in cypher query, see http://docs.neo4j.org/chunked/snapshot/query-set.html . 在cypher查询中使用SET关键字,请参阅http://docs.neo4j.org/chunked/snapshot/query-set.html (Since I have not came across any update query in cypher like in other RDBMS) (因为我没有像其他RDBMS那样在密码中遇到任何更新查询)

NodeA -[r:relatedTo]- NodeB NodeA - [r:relatedTo] - NodeB
try to set value by : SET r.<your property name>="<desired value>"; 尝试通过以下方式设置值: SET r.<your property name>="<desired value>"; before returning any value from start n=node(...)... return n; 在从start n=node(...)... return n;返回任何值之前start n=node(...)... return n; query. 查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM