Database Reference
In-Depth Information
Note
The where clause used in this example filters out the results of the query that you're
not interested in, much like the SQL where clause in a relational database. We'll discuss
the where clause in more detail later in this chapter.
The final result contains two movies ( Heat and Alien ), as you'd expect, given the data set
illustrated in figure 6.1 . Figure 6.6 shows the result after running the query in the Neo4j
Shell.
Figure 6.6. Result of the query execution in Neo4j Shell, finding movie recommendations for the user based on the
movies their friends have seen
You've now used Cypher to find movie recommendations for a user based on friends' rat-
ings, but excluding the movies the user already watched. The solution to the same problem
using Java APIs in chapter 4 resulted in over 40 lines of code. This time you did it in a
5-line Cypher query. The Cypher query is also much more readable and potentially under-
standable for anyone who understands the application domain, even if they don't have any
programming skills.
 
Search WWH ::




Custom Search