Neo4J: Tanggalin ang relasyon

Neo4j Delete Relationship



1. Umiiral na ugnayan

MATCH (n:Person) RETURN n

imahe

2. Hindi mo matatanggal ang mga node na naglalaman ng mga ugnayan

MATCH(p:Person) DELETE p

imahe



Neo.ClientError.Schema.ConstraintValidationFailed: Cannot delete node, because it still has relationships. To delete this node, you must first delete its relationships.

3. Tanggalin ang tinukoy na relasyon

MATCH (p1:Person)-[r:LOVES]-(p2:Person) DELETE p1,p2,r

imahe
Tandaan na ang format ng sugnay na tanggalin ay DELETE ,,



Natitirang relasyon ng entity
imahe



4 、 DETACH Delete

MATCH(p:Person) DETACH DELETE p

imahe

imahe