8.6. Compatibility

Cypher is still changing rather rapidly. Parts of the changes are internal — we add new pattern matchers, aggregators and optimizations or write new query planners, which hopefully makes your queries run faster.

Other changes are directly visible to our users — the syntax is still changing. New concepts are being added and old ones changed to fit into new possibilities. To guard you from having to keep up with our syntax changes, Neo4j allows you to use an older parser, but still gain speed from new optimizations.

There are two ways you can select which parser to use. You can configure your database with the configuration parameter cypher_parser_version, and enter which parser you’d like to use (see the section called “Supported Language Versions”)). Any Cypher query that doesn’t explicitly say anything else, will get the parser you have configured, or the latest parser if none is configured.

The other way is on a query by query basis. By simply putting CYPHER 2.2 at the beginning, that particular query will be parsed with the 2.2 version of the parser. Below is an example using the START clause to access a legacy index:

START n=node:nodes(name = "A")

Accessing entities by id via START

In versions of Cypher prior to 2.2 it was also possible to access specific nodes or relationships using the START clause. In this case you could use a syntax like the following:

START n=node(42)

The use of the START clause to find nodes by ID was deprecated from Cypher 2.0 onwards and is now entirely disabled in Cypher 2.2 and up. You should instead make use of the MATCH clause for starting points. See Section 11.1, “Match” for more information on the correct syntax for this. The START clause should only be used when accessing legacy indexes (see Chapter 35, Legacy Indexing).

Supported Language Versions

Neo4j 2.3 supports the following versions of the Cypher language:

  • Neo4j Cypher 2.3
  • Neo4j Cypher 2.2
  • Neo4j Cypher 1.9

Each release of Neo4j supports a limited number of old Cypher Language Versions. When you upgrade to a new release of Neo4j, please make sure that it supports the Cypher language version you need. If not, you may need to modify your queries to work with a newer Cypher language version.