如何重写Cypher查询,在分组时返回大量节点

时间:2018-05-22 14:36:40

标签: neo4j cypher

我需要此查询来匹配不同的课程和学生。这会给我带来巨额回报,但是当我返回c.name,s.name,count(*)时,结果是正确的。

  match (t:TeacherEntity{name: 'Teacher2'}) -[:teaches] ->(c:CourseEntity)
         <- [sc:student_attends_course] - (s:StudentEntity)
        with c,s
        match (c) - [:course_assignments] -> (a:AssignmentEntity) 
        optional match (a) <- [subm:student_submission] - (s)
        where subm is null or subm.mark < 4
        return c, s,count(*)

有什么想法吗?

0 个答案:

没有答案