如何查询连接了超过2条特定边的节点

举一个例子:一个患者患有3中疾病:高血压、糖尿病、心脏病,一种推荐服用的药物为A,即存在3个tag:患者、疾病、药物,以及4条关系:患者-患有->高血压、患者-患有->糖尿病、患者-患有-心脏病,患者-药物治疗-A。请问这种情况下,能不能通过一条MATCH语句实现查询患有高血压、糖尿病、心脏病的病人适合用什么药物?如果不可以的话,用什么查询语句能够实现呢

查询超过两条特定边的节点 可以通过边上的索引来聚合起点 count() 哈

LOOKUP ON follow | \
  GROUP BY $-.SrcVID YIELD $-.SrcVID as player, count(*) as follow_count | \
  YIELD $-.player, $-.follow_count WHERE $-.follow_count > 2


+-------------+-----------------+
| $-.player   | $-.follow_count |
+-------------+-----------------+
| "player129" | 3               |
+-------------+-----------------+
| "player121" | 3               |
+-------------+-----------------+
| "player150" | 3               |
+-------------+-----------------+
| "player114" | 3               |
+-------------+-----------------+
| "player137" | 3               |
+-------------+-----------------+
| "player104" | 3               |
+-------------+-----------------+
| "player128" | 3               |
+-------------+-----------------+
| "player105" | 3               |
+-------------+-----------------+
| "player113" | 11              |
+-------------+-----------------+
| "player148" | 3               |
+-------------+-----------------+
| "player101" | 3               |
+-------------+-----------------+
| "player136" | 4               |
+-------------+-----------------+

浙ICP备20010487号