The following query getting all groups of specific user then unwind on each result(each group) and should remove all incoming relations only if count relations to that group is 1.
example: group1<-user1 (will delete the incoming relationship to the group)
group1-<user1
group1-<user2 (will remain all incoming relationships to the group)
can assist complete it?
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
Thanks.