【问题标题】:Error when deleting a node using Cypher in Memgraph在 Memgraph 中使用 Cypher 删除节点时出错
【发布时间】:2022-12-30 17:56:01
【问题描述】:

当我尝试删除节点时

MATCH (c:Customer {name: 'John Smith'})
DELETE c;

我收到消息Failed to remove node because of it's existing connections. Consider using DETACH DELETE.。我应该怎么办?

【问题讨论】:

    标签: memgraphdb


    【解决方案1】:

    只需按照错误消息将DELETE替换为DETACH DELETE即可:

    MATCH (c:Customer {name: 'John Smith'})
    DETACH DELETE c;
    

    DELETE只能用在没有关系的节点上。要删除节点及其所有关系,您需要添加DETACH

    【讨论】:

      猜你喜欢
      • 2022-11-26
      • 2012-07-30
      • 2022-12-12
      • 2022-12-30
      • 1970-01-01
      • 1970-01-01
      • 2022-12-21
      • 1970-01-01
      • 2016-01-06
      相关资源
      最近更新 更多