在 Neo4j 2.1.6 中,我有一些节点在某个属性 inputID
方面是非唯一的。
使用 Cypher,如何删除所有在给定属性方面是重复的节点,只留下唯一的节点?
我尝试了以下方法...
MATCH (n:Input)
WITH n.inputID, collect(n) AS nodes
WHERE size(nodes) > 1
FOREACH (n in tail(nodes) | DELETE n)
...但它最终导致了...
Expression in WITH must be aliased (use AS) (line 2, column 6)
"WITH n.inputID, collect(n) AS nodes"
^
谢谢,G