Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-09-2022 05:28 PM
I was reading the basics of the Northwinds recommendation engine to experiment with queries (Northwind Recommendation Engine - graphgists). I tried this query in the online hosted Northwind:
match (c:Customer)-[:PURCHASED]->(o:Order)-[:PRODUCT]->(p:Product)
return c.companyName, p.productName, count(o) as orders
order by orders desc
limit 5
When this runs, I get no records, and I see a squigggly under the [:product] section. The tip that pops up says this relationship doesn't exist. Is this on in the online demo.neo4jlabs.com sample site? Or is there something I need to do to create it?
05-09-2022 07:17 PM
the screenshot shows the node labels and relationship types in the Northwind database. I don't see a PRODUCT relationship type.
It looks like the relationship type between an Order and a Product is ORDERS.
Try this:
match (c:Customer)-[:PURCHASED]->(o:Order)-[:ORDERS]->(p:Product)
return c.companyName, p.productName, count(o) as orders
order by orders desc
limit 5
05-10-2022 08:16 AM
Thanks, that works. I didn't even think about Orders. I'm guessing that someone changed the edges here and lots of sample queries on the site and Internet are now wrong? Could someone add Purchased back?
All the sessions of the conference are now available online