Cypehr Foreach 方法的使用
发布于 4 年前 作者 pangguoming 1474 次浏览 来自 分享

// 将设置路径上所有的节点的 flag 属性为 true

match p = (begin) -[*]-> (end)
where begin.name='a' and end.name = 'z'
foreach (n in nodes(p)  |  set n.flag = true )

// 将列表中的人全部加为 朋友

match (a:User) 
where a.userId = 1
foreach ( name in ['a','b','c']  |  create (a) --> (:User{name:name}) )
回到顶部