有没有办法找到传入的关系属性说“rel_name”集合中的所有节点具有相同的值?

时间:2015-03-26 06:44:43

标签: neo4j

每个节点都有不同属性的多个传入关系。我想找到传入关系属性说“rel_name

  

表示ALL(x IN节点(p))具有相同的值

1 个答案:

答案 0 :(得分:0)

您可以尝试此操作(它返回带有节点数和节点集合的rel_name):

MATCH (a)<-[r]-()
WITH r.rel_name AS name, count(a) AS count, collect(a) AS coll
WHERE count > 1
RETURN name, count, coll
ORDER BY name

或者(它返回所有重复的节点):

MATCH (a)<-[r]-()
WITH r.rel_name AS name, count(a) AS count, collect(a) AS coll
WHERE count > 1
UNWIND coll AS c
RETURN c