【发布时间】: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
当我尝试删除节点时
MATCH (c:Customer {name: 'John Smith'})
DELETE c;
我收到消息Failed to remove node because of it's existing connections. Consider using DETACH DELETE.。我应该怎么办?
【问题讨论】:
标签: memgraphdb
只需按照错误消息将DELETE替换为DETACH DELETE即可:
MATCH (c:Customer {name: 'John Smith'})
DETACH DELETE c;
DELETE只能用在没有关系的节点上。要删除节点及其所有关系,您需要添加DETACH。
【讨论】: