2
下面的查詢獲取特定用戶的所有組則 放鬆對每個結果(每組),並應刪除所有傳入的關係,只有當計數關係到該組是迭代與UNWIND刪除關係1.如何同時使用暗號
example: group1<-user1 (will delete the incoming relationship to the group)
group1-<user1
group1-<user2 (will remain all incoming relationships to the group)
可以協助完成嗎?
MATCH (me:userId{{1})-[rel:relation_group]-(allGroups:GROUP)
unwind userGroups as group
//how to use CASE or WHERE in order to check if this group
has only 1 relationship just remove it
謝謝。
但你如何在每個組上迭代這種方式?因爲你會得到組的列表,並且需要檢查每一個,如果傳入關係的數量是1,則刪除它,否則保留它 – rayman
您不需要迭代,只需在WHERE子句 –
中將模式添加到模式即可工作。可以解釋的訣竅?:) – rayman