[英]Neo4j Cypher query for finding connected nodes with a relationship
I have to write a cypher query where I have employee node connected to each other. 我必须编写一个密码查询,其中我的员工节点相互连接。 What i want that I have to find the employees who are not connected with me but have most common connections.
我想要的是我必须找到与我没有联系但有最常见联系的员工。
Something like the following perhaps : 可能类似于以下内容:
MATCH (p1:Employee {name: "me"})-[:CONNECTED_TO]->(p2:Employee)<-[:CONNECTED_TO]-(p3:Employee)
WHERE NOT (p1)-[:CONNECTED_TO]-(p3)
AND p1 <> p3
RETURN p3.name AS Recommended, count(*) AS Strength ORDER BY Strength DESC
Hope this helps. 希望这可以帮助。
Regards, Tom 问候,汤姆
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.