Database Reference
In-Depth Information
Figure 11-19. Specific Products Purchased by Friends
Listing 11-59. The friendsPurchaseByProduct Method
@Query("MATCH (p:Product) " +
" WHERE lower(p.title) =lower({title}) " +
" WITH p " +
" MATCH (u:User { userId : {userId} } )-[:FOLLOWS]-(f)-[:MADE]->()-[:CONTAINS]->(p) " +
" RETURN p.productId as productId, " +
" p.title as title, " +
" collect(f.firstname + ' ' + f.lastname) as fullname, " +
" null as wordPhrase, count(f) as cfriends " +
"ORDER BY cfriends desc, p.title ")
List<MappedProductUserPurchase> friendsPurchaseByProduct (@Param("userId") String userId,
@Param("title") String title);
Products Purchased by Friends and Matches User's Tags
In this next instance, we want to determine products that have been purchased by friends but also have tags that are
used by the current user. The result of the query is shown in Figure 11-20 .
 
Search WWH ::




Custom Search