我需要删除所有带有User
标签的节点,其上设置了属性deactivated
,但最近创建的20个节点除外。
检索它们很简单:
MATCH (x:User {deactivated: true}) RETURN x ORDER BY x.created_at DESC SKIP 20
什么是等效的删除声明?
答案 0 :(得分:3)
将RETURN
语句替换为WITH
,并将结果传递给DETACH DELETE
。
MATCH (x:User {deactivated: true})
WITH x
ORDER BY x.created_at DESC
SKIP 20
DETACH DELETE x