我有一个节点,有很多邻居(~1M)。我想要获得此节点上所有关系的所有关系类型的列表(应该大约有6种不同的类型)。目前我正在使用
match (n:Label {indexedProperty:"value"}) match (n)-[r]-() return distinct type(r)
但这需要相当长的时间(大约18秒)。
在cypher中有没有一种更有效的方法来做这件事?
发布于 2019-11-20 17:07:07
APOC程序可以在这里提供帮助,请尝试使用apoc.node.relationship.types()
match (n:Label {indexedProperty:"value"})
return apoc.node.relationship.types() as types这将为您提供节点上不同类型的列表。
https://stackoverflow.com/questions/58936167
复制相似问题