8.7. Find people based on similar favorites

Figure 8.6. Graph


To find out the possible new friends based on them liking similar things as the asking person, use a query like this:

Query. 

MATCH me-[:favorite]->stuff<-[:favorite]-person
WHERE me.name = 'Joe' AND NOT (me-[:friend]-person)
RETURN person.name, count(stuff)
ORDER BY count(stuff) DESC

The list of possible friends ranked by them liking similar stuff that are not yet friends is returned.

Result

person.namecount(stuff)
2 rows

"Derrick"

2

"Jill"

1