Reading a "Learning Neo4j" book from Packt publications. Found a query:
match (p:Person)-[b:BOUGHT]->(prod1:Product)-[:MADE_BY]->(br:Brand)<-
[MADE_BY]-(prod2:Product)
with p, br, prod2, count(prod1) as NrOfBrandProducts
where not(p-[:BOUGHT]->prod2) and NrOfBrandProducts > 1
return p.name as Person, br.name as Brand, collect(prod2.name) as
RecommendedProducts
order by Person ASC;
Question: What is the best way to create a [:RECOMMED] relationship from Brand to all products in the collect(prod2)? The query is good but I need the result as a graph not records.
Is FOREACH an option?