cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo.ClientError.Statement.SyntaxError using |

I am stumped here - 

Trying to do a simple match on Node labels. 

I copied DIRECTLY from the cypher manual   https://neo4j.com/docs/cypher-manual/current/clauses/match/#match-with-labels

the code 

MATCH (n:Movie|Person)
RETURN n.name AS name, n.title AS title

 

but when I run it in the sandbox  -   I get this error 

Invalid input '|': expected ")", "WHERE", "{" or a parameter (line 1, column 15 (offset: 14))
"MATCH (n:Movie|Person)"

 Thoughts? 

 

4 REPLIES 4

That is the new version 5 syntax that allows logical expressions for the label condition. The documentation version is selected in the dropdown menu in the upper lefthand side of the window. 

Prior to that, you could construct logical expressions in the 'where' clause, such as:

MATCH (n)
WHERE n:Movie or n:Person
RETURN n.name AS name, n.title AS title

In. the course sandbox we still use V4 of Neo4j so as @glilienfield said, you need to select the V4 docs.

 

Thank you to glilienfield and elaine -    I found the Cypher Manual v4.

So will the test be on version 4 syntax? 

We have not updated the certification exam to test R5 syntax. We will do so after the courses are updated.

Elaine

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online