
I am new in graph database and I am making a fiends relationship. So, here in the screen shot you can see R<->A, R<->B, R<->C (<-> follow each other), now you can see A->D,E,G,H and B->D,F,G,H and C->H,I now you can see the H is common in all these and D and G node common for A and B. So, its a very high possibility that H should be a friend of R and D and G also friend of R.
So, could anyone know to write a cypher query to get the H,D and G node.
@nimrod answer is totally correct and here is the final cypher query
MATCH(u:User{name:"R"})-[:FOLLOWS]->(:User)-[:FOLLOWS]->(unew:User)
WITH COUNT(unew) AS totalNew,unew as finalUsers
WHERE totalNew>=2 AND unew.name<>"R"
Return totalNew,finalUsers
One option is:
Which for the example data:
returns: