在 shell 控制台中执行此命令时出现此错误(我只想从图中忽略超级节点,因为它们会影响我的建议):
neo4j-sh (0)$ cypher 1.9 start n=node:node_auto_index('n_id_customer:*') match n--r with n,count(*) as cnt where cnt > 5000 with n match n--r2 with r2 delete r2;
TransactionFailureException: Unable to commit transaction
直接删除节点时出现相同的错误(后来我意识到我必须先删除它们的关系)。当执行相同的查询但用 RETURN 替换 DELETE 命令时,一切正常:
cypher 1.9 start n=node:node_auto_index('n_id_customer:*') match n--r with n,count(*) as cnt where cnt > 5000 with n match n--r2 with r2 return count(r2);
+-----------+
| count(r2) |
+-----------+
| 181294 |
+-----------+
1 row
20615 ms
neo4j 版本是 1.9。我怎样才能正确轻松地删除/关闭超级节点,这样它们就不会偏向整个图?删除他们的关系也足够了。