0
我爲飼料場景創建了鏈接列表結構。在這裏,我有我的提要持續在neo4j的鏈接列表中。這工作正常。但是,可能需要刪除整個產品,所以我試圖想出一個密碼,可以刪除一個查詢中的產品和相關鏈接列表。 該查詢返回我基於這些線路正確性如何刪除neo4j中的鏈表?
match p = (i:Item {uuid:"d98c299d-239b-40d1-ac2f-01a80ac36db4"})-[:LATEST]-(latestComment), latestComment-[:NEXT*0..]-(olders) return i, latestComment, olders;
,我試着寫一個刪除查詢和使用的foreach其一定的變化,但似乎沒有奏效。
match p = (i:Item {uuid:"d98c299d-239b-40d1-ac2f-01a80ac36db4"})-[:LATEST]-(latestComment), latestComment-[:NEXT*0..]-(olders) delete i, latestComment, olders;
錯誤:
Node record Node[13349,used=false,rel=26286,prop=-1,labels=Inline(0x0:[]),light] still has relationships
用foreach
match (i:Item {uuid:"d98c299d-239b-40d1-ac2f-01a80ac36db4"})-[:LATEST]-(latestComment), latestComment-[:NEXT*0..]-(olders) delete i, foreach (old in olders | delete old)
的變化顯然有什麼不對,但我不能對可能出現的錯誤得到足夠的指針。