I'm trying one query, like this:
MATCH (g:GNE)-[:like]->(c:CLUSTER)<-[:Belong]-(h:GNE)
WHERE g.sym = 'ST1' AND count(c) >=4
RETURN h.sym, count(c) AS score, collect(c.clustInfo), h.chr ORDER BY score DESC
but the expression 'count(c) >= 4' doesn't work... Any suggestions?
You cannot directly use aggregates in a WHERE clause like that, you need to use WITH to create a new variable for testing in subsequent conditions. You query becomes something like:
MATCH (g:GNE{sym:"ST1"})-[:like]->(c:CLUSTER)<-[:Belong]-(h:GNE)
WITH h, COUNT(c) AS score, COLLECT(c.clusterInfo) AS info
ORDER BY score DESC
WHERE score >= 4
RETURN h.sym, score, info, h.chr
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加