As I was following the instruction of the Yelp online training example, I am having trouble establish connection between Yelp sandbox and the web app. !
There seems to be a problem with the Neo4j Cypher runtime and the query in exercise0.js.
The query should be changed to:
MATCH (u:User {id: $userId})
MATCH (u)-[:WROTE]->(r:Review)
WITH u, avg(r.stars) AS averageStars
MATCH (u)-[:WROTE]->(:Review)-[:REVIEWS]->(:Business)-[:IN_CATEGORY]-(c:Category)
WITH u,averageStars, c.name AS category, COUNT(*) AS num ORDER BY num DESC
RETURN u {
.name,
numReviews: toFloat(SIZE((u)-[:WROTE]->(:Review))),
categories: COLLECT(category)[..5],
averageStars
} AS userInfo
We have updated the course code so that when you instantiate the code sandbox, the Cypher code will be correct. There was a change in Cypher that exposed this problem and engineering is looking at it, but for now the new code should work.