Count and operations in Neo4j cypher

quelopes

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?

JohnMark13

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]

編集
0

コメントを追加

0

関連記事

分類Dev

IF ... ELSE with Cypher Neo4J

分類Dev

neo4j Cypher IF THEN ELSE

分類Dev

count(nodes(p))はCypher、Neo4jでどのように機能しますか

分類Dev

Neo4j、Cypher:条件付き作成

分類Dev

Neo4J create temp variable within Cypher

分類Dev

Neo4j cypher: set cutofftime (datetime) property of a node

分類Dev

How to check if an index exist in neo4j cypher

分類Dev

How to check if an index exist in neo4j cypher

分類Dev

Neo4j Cypher - Match relationship condition or null

分類Dev

Neo4j Cypher, return specified relationship only

分類Dev

Neo4j / Cypher - pagination with multiple queries

分類Dev

How to Combine Multiple WITH and MATCH clause in Cypher Neo4j

分類Dev

Neo4JとCypherクエリ

分類Dev

How to merge nodes of the same community with Cypher in Neo4j?

分類Dev

Neo4J Cypher query equivalent to select for update

分類Dev

neo4j cypher : how to query a linked list

分類Dev

Collecting results with optional nodes in Neo4j cypher results

分類Dev

neo4j cypher: "stacking" nodes from query result

分類Dev

Neo4J / Cypherクエリの支援

分類Dev

How to drop a relationship type in Neo4j's Cypher

分類Dev

Neo4j cypher query a known path

分類Dev

Neo4J Aggregation count Globally and not per subgraph

分類Dev

neo4j:uuidを使用したCypher LOAD CSV

分類Dev

Neo4j : how to implement SKIP and LIMIT on a UNION cypher ? What are the alternatives?

分類Dev

Neo4j Cypher:重複ノードをマージ

分類Dev

Neo4j Cypher find node where children do not have attribute value

分類Dev

アレイをCypherと組み合わせる(Neo4j)

分類Dev

NEO4J Cypherクエリ:複数の集計

分類Dev

Neo4j Cypher - How to display graph of all nodes of a certain type with a common node?

Related 関連記事

  1. 1

    IF ... ELSE with Cypher Neo4J

  2. 2

    neo4j Cypher IF THEN ELSE

  3. 3

    count(nodes(p))はCypher、Neo4jでどのように機能しますか

  4. 4

    Neo4j、Cypher:条件付き作成

  5. 5

    Neo4J create temp variable within Cypher

  6. 6

    Neo4j cypher: set cutofftime (datetime) property of a node

  7. 7

    How to check if an index exist in neo4j cypher

  8. 8

    How to check if an index exist in neo4j cypher

  9. 9

    Neo4j Cypher - Match relationship condition or null

  10. 10

    Neo4j Cypher, return specified relationship only

  11. 11

    Neo4j / Cypher - pagination with multiple queries

  12. 12

    How to Combine Multiple WITH and MATCH clause in Cypher Neo4j

  13. 13

    Neo4JとCypherクエリ

  14. 14

    How to merge nodes of the same community with Cypher in Neo4j?

  15. 15

    Neo4J Cypher query equivalent to select for update

  16. 16

    neo4j cypher : how to query a linked list

  17. 17

    Collecting results with optional nodes in Neo4j cypher results

  18. 18

    neo4j cypher: "stacking" nodes from query result

  19. 19

    Neo4J / Cypherクエリの支援

  20. 20

    How to drop a relationship type in Neo4j's Cypher

  21. 21

    Neo4j cypher query a known path

  22. 22

    Neo4J Aggregation count Globally and not per subgraph

  23. 23

    neo4j:uuidを使用したCypher LOAD CSV

  24. 24

    Neo4j : how to implement SKIP and LIMIT on a UNION cypher ? What are the alternatives?

  25. 25

    Neo4j Cypher:重複ノードをマージ

  26. 26

    Neo4j Cypher find node where children do not have attribute value

  27. 27

    アレイをCypherと組み合わせる(Neo4j)

  28. 28

    NEO4J Cypherクエリ:複数の集計

  29. 29

    Neo4j Cypher - How to display graph of all nodes of a certain type with a common node?

ホットタグ

アーカイブ