When attempting to run this query on a database with Animal type vertices:
optional match (n {name:"A342"})
match(n:Animal)
return n
I encountered the following error: Neo.ClientError.Statement.SyntaxError: MATCH cannot follow OPTIONAL MATCH (perhaps use a WITH clause between them) (line 2, column 1 (offset: 33)) "match(n:Animal)" ^ but didn't find any explicit mention in the documentation forbidding this, so I wanted to check if there are any underlying issues with OPTIONAL MATCH before MATCH clauses that make it impossible. Thanks!
Using Neo4j 3.5.6 Community Edition.
Hi, thanks for reporting.
I believe that this error is the expected behavior, but that we should at least look into if the documentation needs to be updated to cover this case better.
Best Regards,
Therese, Team Cypher
This has been fixed in neo4j 4.0, where a beta version is already available.
Hi,
To clarify, do you mean that having a match clause after an optional match clause is now allowed in neo4j 4.0, or that the documentation will specify that it's not allowed?
Right, I should have mentioned that. It is now allowed.
Most helpful comment
Right, I should have mentioned that. It is now allowed.