3.8. Deprecations, additions and compatibility

Cypher is a language that is constantly evolving. New features get added to the language continuously, and occasionally, some features become deprecated and are subsequently removed.

3.8.1. Removals, deprecations, additions and extensions

The following tables lists all the features which have been removed, deprecated, added or extended in Cypher. Replacement syntax for deprecated and removed features are also indicated.

3.8.1.1. Version 3.0

Feature Type Change Details

has()

Function

Removed

Replaced by exists()

str()

Function

Removed

Replaced by toString()

{parameter}

Syntax

Deprecated

Replaced by $parameter

properties()

Function

Added

 

CALL [...YIELD]

Clause

Added

 

point() - cartesian 2D

Function

Added

 

point() - WGS 84

Function

Added

 

distance()

Function

Added

 

User-defined procedures

Functionality

Added

 

toString()

Function

Extended

Now also allows Boolean values as input

3.8.1.2. Version 3.1

Feature Type Change Details

rels()

Function

Deprecated

Replaced by relationships()

toInt()

Function

Deprecated

Replaced by toInteger()

lower()

Function

Deprecated

Replaced by toLower()

upper()

Function

Deprecated

Replaced by toUpper()

toBoolean()

Function

Added

 

Map projection

Syntax

Added

 

Pattern comprehension

Syntax

Added

 

User-defined functions

Functionality

Added

 

CALL...YIELD...WHERE

Clause

Extended

Records returned by YIELD may be filtered further using WHERE

3.8.1.3. Version 3.2

Feature Type Change Details

CYPHER planner=rule (Rule planner)

Functionality

Removed

All queries now use the cost planner. Any query prepended thus will fall back to using Cypher 3.1.

CREATE UNIQUE

Clause

Removed

Running such queries will fall back to using Cypher 3.1 (and use the rule planner)

START

Clause

Removed

Running such queries will fall back to using Cypher 3.1 (and use the rule planner)

MATCH (n)-[rs*]-() RETURN rs

Syntax

Deprecated

Replaced by MATCH p=(n)-[*]-() RETURN relationships(p) AS rs

MATCH (n)-[:A|:B|:C {foo: 'bar'}]-() RETURN n

Syntax

Deprecated

Replaced by MATCH (n)-[:A|B|C {foo: 'bar'}]-() RETURN n

MATCH (n)-[x:A|:B|:C]-() RETURN n

Syntax

Deprecated

Replaced by MATCH (n)-[x:A|B|C]-() RETURN n

MATCH (n)-[x:A|:B|:C*]-() RETURN n

Syntax

Deprecated

Replaced by MATCH (n)-[x:A|B|C*]-() RETURN n

User-defined aggregation functions

Functionality

Added

 

Composite indexes

Index

Added

 

Node Key

Index

Added

Neo4j Enterprise Edition only

CYPHER runtime=compiled (Compiled runtime)

Functionality

Added

Neo4j Enterprise Edition only

reverse()

Function

Extended

Now also allows a list as input

max(), min()

Function

Extended

Now also supports aggregation over a set containing both strings and numbers

3.8.1.4. Version 3.3

Feature Type Change Details

START

Clause

Removed

As in Cypher 3.2, any queries using the START clause will revert back to Cypher 3.1 planner=rule. However, there are built-in procedures for accessing explicit indexes that will enable users to use the current version of Cypher and the cost planner together with these indexes. An example of this is CALL db.index.explicit.searchNodes('my_index','email:me*').

CYPHER runtime=slotted (Faster interpreted runtime)

Functionality

Added

Neo4j Enterprise Edition only

max(), min()

Function

Extended

Now also supports aggregation over sets containing lists of strings and/or numbers, as well as over sets containing strings, numbers, and lists of strings and/or numbers

3.8.2. Compatibility

Older versions of the language can still be accessed if required. There are two ways to select which version to use in queries.

  1. Setting a version for all queries: You can configure your database with the configuration parameter cypher.default_language_version, and enter which version you’d like to use (see Section 3.8.3, “Supported language versions”). Every Cypher query will use this version, provided the query hasn’t explicitly been configured as described in the next item below.
  2. Setting a version on a query by query basis: The other method is to set the version for a particular query. Prepending a query with CYPHER 2.3 will execute the query with the version of Cypher included in Neo4j 2.3.

Below is an example using the has() function:

CYPHER 2.3
MATCH (n:Person)
WHERE has(n.age)
RETURN n.name, n.age

3.8.3. Supported language versions

Neo4j 3.3 supports the following versions of the Cypher language:

  • Neo4j Cypher 3.3
  • Neo4j Cypher 3.2
  • Neo4j Cypher 3.1
  • Neo4j Cypher 2.3

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.