07-27-2023, 03:02 AM
I'm trying to find all the nodes with more than one incoming relationship. Given this data:
a-[has]->b
a-[has]->c
d-[has]->b
So, I'm looking for a query that returns 'b', because it has more that one incoming.
This query is close. It returns 'a' and 'b', because they both have 2 relations:
match (n)--()
with n,count(*) as rel_cnt
where rel_cnt > 1
return n;
However, this query (the addition of '-->') doesn't return any and I don't know why:
match (n)-->()
with n,count(*) as rel_cnt
where rel_cnt > 1
return n;
Am I going about this all wrong?
a-[has]->b
a-[has]->c
d-[has]->b
So, I'm looking for a query that returns 'b', because it has more that one incoming.
This query is close. It returns 'a' and 'b', because they both have 2 relations:
match (n)--()
with n,count(*) as rel_cnt
where rel_cnt > 1
return n;
However, this query (the addition of '-->') doesn't return any and I don't know why:
match (n)-->()
with n,count(*) as rel_cnt
where rel_cnt > 1
return n;
Am I going about this all wrong?