因此,想象一下,在“我的”中,您有一个关系,[event] --> [person],而这个事件可以与同一个人有很多关系。例如:
/-----------\
/---------v v
event----->[person]
\---------^在这种情况下,我们有一个事件与这个person节点有3个关系。(这可能会有很多次)
,我的问题,只是选择那些有超过x的关系。
现在我有个疑问。
MATCH (e:Event)-[r:FOLLOWS]->(f:Follows { name: "ExamplePerson"})
with e, count(r) as alias
where alias > 3
return e, alias但这是返回全部关系,例如:
/------------- \
/------------v v
event----->[person1]
\---------^
\---------->[person2]=4而不是3.我还尝试了以下几种方法:
MATCH (e:Event)-[r:FOLLOWS]->(f:Follows { name: "ExamplePerson"})
with e, count((e:Event)-[r:FOLLOWS]->(f:Follows { name: "ExamplePerson"})) as alias
where alias > 3
return e, alias没有成功,我做错了什么?
发布于 2015-05-29 13:07:51
试着为同一个人分组,例如在您的第一次尝试中进行此更改:
MATCH (e:Event)-[r:FOLLOWS]->(f:Follows { name: "ExamplePerson"})
with e, f, count(r) as alias
where alias > 3
return e, f, aliashttps://stackoverflow.com/questions/30519471
复制相似问题