I just started with Neo4j and I can't find an answer to my question or tried to solve it the wrong way because none of it was at least close to solving my problem.
I have graph where part of it looks like this
(A)-[ x ]->(B)<-[ y ]-(C)
I need to get the A node that has connected B nodes with at least 10 C nodes connected to it and get the B node amount, so it will give a result like this.
oh Yes. i forgot to change that..
I made sample dataset and relationship direction as above however @knoxrnox can try with the his own dataset and relationship direction
Alternately you can use the size() function in a WHERE clause to get the count of paths matching the pattern:
MATCH (a:A)-[x:X]->(b:B)
WHERE size((b)<-[:Y]-(:C)) > 10
RETURN a.key as a, count(b) as bCount
Though note that we do not know that b is connected to more than 10 distinct :C nodes...if multiple :Y relationships from a :B node can connect to the same :C node, then this won't be accurate. If you need counts to distinct :C nodes, then you will have to MATCH out the whole pattern and do a series of count aggregations.