Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j Cypher-如何使用Cypher有效地计算多个属性值并正确分页_Neo4j_Cypher - Fatal编程技术网

Neo4j Cypher-如何使用Cypher有效地计算多个属性值并正确分页

Neo4j Cypher-如何使用Cypher有效地计算多个属性值并正确分页,neo4j,cypher,Neo4j,Cypher,我正在努力获得正确的密码,既有效又允许通过跳过和限制分页 下面是一个简单的场景:我有相关的节点(公司),您可以将与和聚合一起使用,还可以选择映射结果 match (c:Company {id: 'MY.co'})<-[:type_of]-(s:Set)<-[:job_for]-(j:Job) with s, j.Status as Status,count(*) as StatusCount return s.Description, collect([Status,StatusC

我正在努力获得正确的密码,既有效又允许通过跳过和限制分页


下面是一个简单的场景:我有相关的节点(公司),您可以将
和聚合一起使用,还可以选择映射结果

match (c:Company {id: 'MY.co'})<-[:type_of]-(s:Set)<-[:job_for]-(j:Job) 
with s, j.Status as Status,count(*) as StatusCount
return s.Description, collect([Status,StatusCount]);

match(c:Company{id:'MY.co'})这非常有效!谢谢我曾试图找出如何以这种方式使用collect,但没有成功。这仍然是有效的,并允许对集合进行分页。
s.Description        j.Status       StatusCount
-------------------+--------------+----------------
Set 1              | Unassigned   | 10
Set 1              | Completed    | 2
Set 2              | Unassigned   | 3
Set 1              | Reviewed     | 10
Set 3              | Completed    | 4
Set 2              | Reviewed     | 7
s.Description        Unassigned      Completed    Reviewed
-------------------+--------------+-------------+----------
Set 1              | 10           | 2           | 10
Set 2              | 3            | 0           | 7
Set 3              | 0            | 4           | 0
match (c:Company {id: 'MY.co'})<-[:type_of]-(s:Set)<-[:job_for]-(j:Job) 
with s, j.Status as Status,count(*) as StatusCount
return s.Description, collect({Status:Status,StatusCount:StatusCount]) as StatusCounts;


   List<Object> statusMaps =  (List<Object>) row.get("StatusCounts");
   for(Object statusEntry : statusMaps ) {
     Map<String,Object> statusMap = (Map<String,Object>) statusEntry;
     String status = (String) statusMap.get("Status");
     Number count = statusMap.get("StatusCount");
    }
match (c:Company {id: 'MY.co'})<-[:type_of]-(s:Set)<-[:job_for]-(j:Job) 
with s, j.Status as Status,count(*) as StatusCount
return s.Description, collect([Status,StatusCount]);
match (c:Company {id: 'MY.co'})<-[:type_of]-(s:Set)<-[:job_for]-(j:Job) 
with s, j.Status as Status,count(*) as StatusCount
return s.Description, collect({Status:Status,StatusCount:StatusCount]);