diff --git a/extended/src/main/java/apoc/ttl/TTLLifeCycle.java b/extended/src/main/java/apoc/ttl/TTLLifeCycle.java index b64d72e58f..f66bf5753e 100644 --- a/extended/src/main/java/apoc/ttl/TTLLifeCycle.java +++ b/extended/src/main/java/apoc/ttl/TTLLifeCycle.java @@ -64,7 +64,7 @@ public void expireNodes(long limit) { ); long nodesDeleted = db.executeTransactionally( - "CALL apoc.periodic.iterate($queryNodes, 'MATCH (n) WHERE id(n) = id DELETE n', {batchSize: $batchSize})", + "CALL apoc.periodic.iterate($queryNodes, 'MATCH (n) WHERE id(n) = id DETACH DELETE n', {batchSize: $batchSize})", params, result -> Iterators.single(result.columnAs("total")) );