0
如何刪除所有深中的相關節點到主節點的一些屬性,例如「Trojańska」的Neo4j刪除所有深中的相關節點
CREATE (spol:Spoldzielnia { value : 'Poludnie' })
CREATE (mT:Home { value : 'Trojanska' })
CREATE (mR:Home { value : 'Renesansowa' })
CREATE (mK:Home { value : 'Kasandry' })
CREATE (pS:Person { value : 'Slawek' })
CREATE (pR:Person { value : 'Remek' })
CREATE (pW:Person { value : 'Wojtek' })
CREATE (pK:Person { value : 'Krzychu' })
CREATE (pB:Person { value : 'Bolek' })
CREATE (pC:Person { value : 'Czesław' })
CREATE (pTT:Person { value : 'Tosiek' })
CREATE (pZZ:Person { value : 'Zbychu' })
CREATE (pWW:Person { value : 'Wlodek' })
CREATE (pFF:Person { value : 'Franko' })
CREATE (pMM:Person { value : 'Mietek' })
CREATE (i01:Item { value : 'telefon'})
CREATE (i02:Item { value : 'komputer'})
CREATE (i03:Item { value : 'laptop'})
CREATE (i04:Item { value : 'telefon'})
CREATE (i05:Item { value : 'komputer'})
CREATE (i06:Item { value : 'laptop'})
CREATE (i07:hardware { value : 'modem'})
CREATE (i08:option { value : 'wifi'})
CREATE (i09:option { value : 'usb'})
CREATE (mT)-[:HAS]->(spol)
CREATE (mR)-[:HAS]->(spol)
CREATE (mK)-[:HAS]->(spol)
CREATE (pS)-[:HAS]->(mT)
CREATE (pR)-[:HAS]->(mT)
CREATE (pW)-[:HAS]->(mT)
CREATE (pK)-[:HAS]->(mR)
CREATE (pB)-[:HAS]->(mR)
CREATE (pC)-[:HAS]->(mR)
CREATE (pTT)-[:HAS]->(mK)
CREATE (pZZ)-[:HAS]->(mK)
CREATE (pWW)-[:HAS]->(mK)
CREATE (pFF)-[:HAS]->(mK)
CREATE (pMM)-[:HAS]->(mK)
CREATE (i01)-[:HAS]->(pS)
CREATE (i02)-[:HAS]->(pS)
CREATE (i03)-[:HAS]->(pS)
CREATE (i04)-[:HAS]->(pR)
CREATE (i05)-[:HAS]->(pR)
CREATE (i06)-[:HAS]->(pR)
CREATE (i07)-[:HAS]->(i02)
CREATE (i08)-[:HAS]->(i07)
CREATE (i09)-[:HAS]->(i06)
例如我想刪除有關「Trojanska」的所有節點和結果,我希望得到的東西是這樣的:
Delete: Trojanska
Delete: Trojanska -> Slawek
Delete: Trojanska -> Slawek -> telefon
Delete: Trojanska -> Slawek -> komputer
Delete: Trojanska -> Slawek -> komputer -> modem
Delete: Trojanska -> Slawek -> komputer -> modem -> wifi
Delete: Trojanska -> Slawek -> laptop
Delete: Trojanska -> Wojtek
Delete: Trojanska -> Remek -> telefon
Delete: Trojanska -> Remek -> komputer
Delete: Trojanska -> Remek -> laptop
Delete: Trojanska -> Remek -> laptop -> usb