Created
April 17, 2013 18:44
-
-
Save trentonstrong/5406696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"START n=node:`entity-type-index`('entity-type:USER') | |
MATCH n<-[:`type-of`]-opaluser, | |
opaluser-[:`is-opal-user`]-user, | |
user-[:`fb-friend`]->friend<-[:`fb-friend`]-person | |
WHERE NOT id(person)=id(user) | |
WITH user, person, length(collect(DISTINCT friend)) as number | |
CREATE UNIQUE user-[r:`fb-mutual-friends`]->person | |
SET r.`mutual-friends` = number | |
RETURN DISTINCT user.`fb-name`, user, collect(DISTINCT [person.`fb-name`, r.`mutual-friends`]) as people" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment