Home > front end >  Cannot run Cypher query
Cannot run Cypher query

Time:05-17

I have to do that:Find the students who are over 22 years old and are studying Databases. Expected result:

MATCH (p:Student)-[:Study]->(s:Subject)
WHERE p.age > 22 AND s.name = “Databases” 
RETURN p
Invalid input '“': expected whitespace, comment or an expression (line 2, column 31 (offset: 70))
"WHERE p.age > 22 AND s.name = “Databases”"

CodePudding user response:

You are using the wrong double quotes (“ instead of "). The query should be:

MATCH (p:Student)-[:Study]->(s:Subject)
WHERE p.age > 22 AND s.name = "Databases"
RETURN p

CodePudding user response:

Try using single quotes

MATCH (p:Student)-[:Study]->(s:Subject)
WHERE p.age > 22 AND s.name = 'Databases' 
RETURN p
  • Related