Skip to content

Commit 0181894

Browse files
committed
docs(notebooks): add DETACH DELETE rationale in langchain cleanup cell
1 parent b6ae1c5 commit 0181894

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

demo/notebooks/02_langchain_graph_chain.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"metadata": {},
280280
"outputs": [],
281281
"source": [
282-
"graph.query(\"MATCH (n) WHERE n.name ENDS WITH $tag DETACH DELETE n # atomically removes edges before deleting node\", params={\"tag\": tag})\nprint(\"Cleaned up\")\ngraph.close()\nclient.close() # injected client — owned by caller"
282+
"# DETACH DELETE atomically removes all edges then the node in one operation.\n# Two-step MATCH (n)-[r]-() / DELETE r / DELETE n is avoided because an\n# undirected MATCH returns each edge from both endpoints, so the second pass\n# fails with \"cannot delete node with connected edges\".\ngraph.query(\"MATCH (n) WHERE n.name ENDS WITH $tag DETACH DELETE n\", params={\"tag\": tag})\nprint(\"Cleaned up\")\ngraph.close()\nclient.close() # injected client — owned by caller"
283283
]
284284
}
285285
],

0 commit comments

Comments
 (0)