java 如何更新或更改密码 neo4j 中的值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16963183/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to Update or change value in cypher neo4j
提问by agpt
Is there any update query in cypher using which we can update the property of any node or relationship ?
For e.g. I have following node and relationship:
NodeA-[r:relatedTo]-NodeB
where relatedTois a relationship having properties like activeor inactive
cypher 中是否有任何更新查询,我们可以使用它来更新任何节点或关系的属性?
例如,我有以下节点和关系:
NodeA-[r:relatedTo]- NodeB
其中relatedTo是具有活动或非活动等属性的关系
How can I change this property using cypher query ?
如何使用密码查询更改此属性?
回答by agpt
using SET
keyword in cypher query, see http://docs.neo4j.org/chunked/snapshot/query-set.html. (Since I have not came across any update query in cypher like in other RDBMS)
SET
在密码查询中使用关键字,请参阅http://docs.neo4j.org/chunked/snapshot/query-set.html。(因为我没有像在其他 RDBMS 中那样在 cypher 中遇到任何更新查询)
NodeA-[r:relatedTo]-NodeB
try to set value by : SET r.<your property name>="<desired value>";
before returning any value from start n=node(...)... return n;
query.
NodeA-[r:relatedTo]- NodeB在从查询返回任何值之前
尝试通过 : 设置值。SET r.<your property name>="<desired value>";
start n=node(...)... return n;