[英]Create relationship between nodes in neo4j
1)如果簡單:
// Choose a pair of students with common teacher
MATCH p = (S1:Student)-[:has_teacher]->(T:Teacher)<-[:has_teacher]-(S2:Student)
// Without [:common_teacher] relationships
WHERE NOT (S1)-[:common_teacher]-(S2)
// And create relationships
CREATE (S1)-[r1:common_teacher]->(S2)
CREATE (S2)-[r2:common_teacher]->(S1)
2)如果相反:
您無需在學生之間創建其他關系,因為他們已經受到普通教師的約束。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.