Skip to content

Instantly share code, notes, and snippets.

@Iknewthisguy
Created September 18, 2012 23:01
Show Gist options
  • Save Iknewthisguy/3746578 to your computer and use it in GitHub Desktop.
Save Iknewthisguy/3746578 to your computer and use it in GitHub Desktop.
Full query
START n=node(#{self.id})
MATCH
(n)-[:friends]->(y)-[:friends]->(z)<-[:`OfferJobResume#resumeuser`]-(t)
WHERE
(z-[:friends]->y-[:friends]->n)
AND NOT(n-[:friends]->z-[:friends]->n)
AND NOT(n-[:blocked_friends]->y-[:blocked_friends|friends]->z)
AND NOT(n-[:blocked_friends|friends]->y-[:blocked_friends]->z)
AND NOT(n-[:blocked_friends]->z)
AND NOT(has(z.deleted_at))
WITH n, collect(distinct(z)) as foaf
MATCH
(n)-[:outer_only_friends|friends]->(i)-[:outer_only_friends|friends]->(n)
WHERE
(i<-[:`OfferJobResume#resumeuser`]-r)
AND NOT(n-[:friends]->i-[:friends]->n)
AND NOT(n-[:blocked_friends]->i)
AND NOT(has(i.deleted_at))
WITH n, collect(distinct(i)) as outeronly,foaf
RETURN collect(foaf + outeronly) as total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment