Incorrect result size: expected at most 1

The following error was reported when using spring-data-neo4j to regenerate the knowledge graph:
Insert picture description here
Reason: The original data in neo4j was not deleted before the knowledge graph was regenerated, and the same data was obtained multiple times when the data was obtained.

Report Incorrect result size: expected at most 1 error Most of the reasons are duplicate data in the database!

Solution: delete the data in neo4j first, as follows

TSGraphController:

 	// 清空知识图谱
    @RequiresRoles("user")
    @RequestMapping(method = RequestMethod.DELETE,value = "/delete")
    public Result deleteTSGraph(){
    
    
        studentService.deleteAll();
        teacherAndStudentService.deleteAll();
        return new Result(true, StatusCode.OK,"Neo4j 数据已经全部清空!");
    }

TeacherAndStudentServiceI:

 	//删除neo4j中全部结点
    void deleteAll();

TeacherAndStudentServiceImpl:

  	@Override
    public void deleteAll(){
    
    
        teacherAndStudentDao.deleteAll();
    }

Guess you like

Origin blog.csdn.net/qq_39688282/article/details/114879825