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.

CYPHER 3.5 prefix does not work in 4.0

Reiner
Graph Buddy

Contrary to the documentation (https://neo4j.com/docs/cypher-manual/current/syntax/parameters/), the following command does not work in version 4.0 (4.0.0 Enterprise, local db in Neo4j Desktop):

CYPHER 3.5
MATCH (n:Person)
WHERE n.age > {agelimit}
RETURN n.name, n.age

Neo.ClientError.Statement.SyntaxError

The old parameter syntax {param} is no longer supported. Please use $param instead (line 3, column 15 (offset: 42)) "WHERE n.age > {agelimit}"

7 REPLIES 7

Parameters should be prefixed with $ in 4.0 instead of curly brackets. Just write $agelimit instead of {agelimit}

Reiner
Graph Buddy

Yes, sure. I was referring to the compatibility features in the documentation that say that the old syntax can be executed with that CYPHER 3.5 prefix. In that case the query should be executed with a warning, but there is the same error as trying it without that prefix.

see documentation: https://neo4j.com/docs/cypher-manual/current/deprecations-additions-removals-compatibility/#cypher-c...

Without the CYPHER 3.5 prefix this query would fail with a syntax error. With CYPHER 3.5 however, it will only generate a warning and still work.

There is a bug here that I believe will go out with the next patch release, which should again allow {} type params to work as expected when using the CYPHER 3.5 prefix.

Ok, thanks for that information. Is this bug affecting the Cypher query prefixing only or also the Cypher version setting in the configuration file?

I believe it affected both. And the 4.0.1 patch should have fixed this, please let us know if you are still running into problems here.

I am using Neo4j 4.0.3 with Neo4j Desktop Neo4j 1.2.7. I am getting this same error while using ORM/OGMs like neomodel or py2neo


py2neo.database.ClientError: SyntaxError: The old parameter syntax {param} is no longer supported. Please use $param instead (line 1, column 45 (offset: 44))

"MATCH (_:CommConfig) WHERE _.BaseConfigId = {1} RETURN _"

Unless you're using the CYPHER 3.5 prefix, this is likely only a tangentially related question.

You may want to check to see if you're using the right versions of your ORM/OGM libraries, they would need to be new enough to work with Neo4j 4.0.x. Likely you're using older versions that have not yet changed the syntax of their emitted Cypher.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online