如何调试" py2neo.database.status.ConstraintViolationException:约束已经存在"在flaskr和neo4j?

时间:2016-11-28 20:09:54

标签: python neo4j

calloc(sizeof(int[rows][cols]), 1)

1 个答案:

答案 0 :(得分:2)

为避免ConstraintViolationException,您可以使用APOC程序apoc.schema.assert来确保所有"架构" (索引和约束)你需要存在。

  • 如果呼叫中指定的任何架构尚不存在,则会创建它们。
  • 但请注意,调用中未指定的任何预先存在的架构都将被删除。

有一个如何在this section of the APOC documentation中间使用apoc.schema.assert的示例。