简体   繁体   English

如何使用Cypher修改列表节点属性?

[英]How Can I Revise a List Node Property Using Cypher?

I have nodes in my graph that contain properties that are of type double[]. 我的图中的节点包含类型为double []的属性。 How can I do something like this in cypher? 我该如何在密码中做类似的事情?

for (int i=0; i < theArray.length(); i++)
    theArray[i] *= .8; 

This obviously doesn't work, but here is the general idea: 这显然是行不通的,但这是一般的想法:

start a = node(0)
a.theArray = a.theArray*.8
return a;

You can use extract for that which is like map and creates a new collection. 您可以将extract用于map并创建一个新集合。

start n=node(0) 
set n.foo=extract(x in [1,2,3] : x*0.8)
return n

set n.foo = extract(x in n.foo : x*0.8)

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

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