Deprecations, additions and compatibility

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

This section list all of the features that have been removed, deprecated, added, or extended in different Cypher versions. Replacement syntax for deprecated and removed features are also indicated.

Version 5.2

Updated features

Feature Details

Syntax Updated

CREATE COMPOSITE DATABASE name OPTIONS {}

Creating composite databases now allows for an empty options clause. There are no applicable option values for composite databases.

Version 5.1

Deprecated features

Feature Details

Functionality Deprecated

CREATE TEXT INDEX ... OPTIONS {indexProvider: `text-1.0`}

The text index provider text-1.0 is deprecated and replaced by text-2.0.

Updated features

Feature Details

Functionality Updated

CREATE TEXT INDEX ... OPTIONS {indexProvider: `text-2.0`}

A new text index provider is available, text-2.0. This is also the default provider if none is given.

Version 5.0

Removed features

Feature Details

Syntax Removed

SHOW EXISTS CONSTRAINTS
SHOW NODE EXISTS CONSTRAINTS
SHOW RELATIONSHIP EXISTS CONSTRAINTS

Replaced by:

SHOW [PROPERTY] EXIST[ENCE] CONSTRAINTS
SHOW NODE [PROPERTY] EXIST[ENCE] CONSTRAINTS
SHOW REL[ATIONSHIP] [PROPERTY] EXIST[ENCE] CONSTRAINTS

Syntax Removed

SHOW INDEXES BRIEF
SHOW CONSTRAINTS BRIEF

Replaced by:

SHOW INDEXES
SHOW CONSTRAINTS

Syntax Removed

SHOW INDEXES VERBOSE
SHOW CONSTRAINTS VERBOSE

Replaced by:

SHOW INDEXES YIELD *
SHOW CONSTRAINTS YIELD *

Functionality Removed

DROP INDEX ON :Label(prop)

Replaced by:

DROP INDEX name

Functionality Removed

DROP CONSTRAINT ON (n:Label) ASSERT (n.prop) IS NODE KEY
DROP CONSTRAINT ON (n:Label) ASSERT (n.prop) IS UNIQUE
DROP CONSTRAINT ON (n:Label) ASSERT exists(n.prop)
DROP CONSTRAINT ON ()-[r:Type]-() ASSERT exists(r.prop)

Replaced by:

DROP CONSTRAINT name

Syntax Removed

CREATE INDEX ON :Label(prop)

Replaced by:

CREATE INDEX FOR (n:Label) ON (n.prop)

Syntax Removed

CREATE CONSTRAINT ON ... ASSERT ...

Replaced by:

CREATE CONSTRAINT FOR ... REQUIRE ...

Functionality Removed

CREATE BTREE INDEX ...

B-tree indexes are removed.

B-tree indexes used for string queries are replaced by:

CREATE TEXT INDEX ...

B-tree indexes used for spatial queries are replaced by:

CREATE POINT INDEX ...

B-tree indexes used for general queries or property value types are replaced by:

CREATE [RANGE] INDEX ...

These new indexes may be combined for multiple use cases.

Functionality Removed

CREATE INDEX
...
OPTIONS "{" btree-option: btree-value[, ...] "}"

Functionality Removed

SHOW BTREE INDEXES

B-tree indexes are removed.

Replaced by:

SHOW {POINT | RANGE | TEXT} INDEXES

Functionality Removed

USING BTREE INDEXES

B-tree indexes are removed.

Replaced by:

USING {POINT | RANGE | TEXT} INDEX

Functionality Removed

CREATE CONSTRAINT
...
OPTIONS "{" btree-option: btree-value[, ...] "}"

Node key and uniqueness constraints backed by B-tree indexes are removed.

Replaced by:

CREATE CONSTRAINT ...

Constraints used for string properties require an additional text index to cover the string queries properly. Constraints used for point properties require an additional point index to cover the spatial queries properly.

Functionality Removed

SHOW INDEXES YIELD uniqueness

The uniqueness output has been removed along with the concept of index uniqueness, as it actually belongs to the constraint and not the index.

The new column owningConstraint was introduced to indicate whether an index belongs to a constraint or not.

Functionality Removed

SHOW CONSTRAINTS YIELD ownedIndexId

The ownedIndexId output has been removed and replaced by the new ownedIndex column.

Syntax Removed
For privilege commands:

ON DEFAULT DATABASE

Replaced by:

ON HOME DATABASE

Syntax Removed
For privilege commands:

ON DEFAULT GRAPH

Replaced by:

ON HOME GRAPH

Functionality Removed

SHOW TRANSACTIONS YIELD allocatedBytes

The allocatedBytes output has been removed, because it was never tracked and thus was always 0.

Syntax Removed

exists(prop)

Replaced by:

prop IS NOT NULL

Syntax Removed

NOT exists(prop)

Replaced by:

prop IS NULL

Syntax Removed

0...

Replaced by 0o....

Syntax Removed

0X...

Only 0x... (lowercase x) is supported.

Syntax Removed

MATCH ()-[r]-()
RETURN [ ()-[r]-()-[r]-() | r ] AS rs

Remaining support for repeated relationship variables is removed.

Syntax Removed

WHERE [1,2,3]

Automatic coercion of a list to a boolean is removed.

Replaced by:

WHERE NOT isEmpty([1, 2, 3])

Functionality Removed

distance(n.prop, point({x:0, y:0})

Replaced by:

point.distance(n.prop, point({x:0, y:0})

Functionality Removed

point({x:0, y:0}) <= point({x:1, y:1}) <= point({x:2, y:2})

The ability to use operators <, , >, and >= on spatial points is removed. Instead, use:

point.withinBBox(point({x:1, y:1}), point({x:0, y:0}), point({x:2, y:2}))

Syntax Removed

USING PERIODIC COMMIT ...

Replaced by:

CALL {
  ...
} IN TRANSACTIONS

Syntax Removed

CREATE (a {prop:7})-[r:R]->(b {prop: a.prop})

It is no longer allowed to have CREATE clauses in which a variable introduced in the pattern is also referenced from the same pattern.

Syntax Removed

CALL { RETURN 1 }

Unaliased expressions are no longer supported in subquery RETURN clauses. Replaced by:

CALL { RETURN 1 AS one }

Syntax Removed

MATCH (a) RETURN (a)--()

Pattern expressions producing lists of paths are no longer supported, but they can still be used as existence predicates, for example in WHERE clauses. Instead, use a pattern comprehension:

MATCH (a) RETURN [p=(a)--() | p]

Functionality Removed

MATCH (n) RETURN n.propertyName_1, n.propertyName_2 + count(*)

Implied grouping keys are no longer supported. Only expressions that do not contain aggregations are still considered grouping keys. In expressions that contain aggregations, the leaves must be either:

  • An aggregation

  • A literal

  • A parameter

  • A variable, ONLY IF it is either: 1) A projection expression on its own (e.g. the n in RETURN n AS myNode, n.value + count(*))
    2) A local variable in the expression (e.g the x in RETURN n, n.prop + size([ x IN range(1, 10) | x ])

  • Property access, ONLY IF it is also a projection expression on its own (e.g. the n.prop in RETURN n.prop, n.prop + count(*))

  • Map access, ONLY IF it is also a projection expression on its own (e.g. the map.prop in WITH {prop: 2} AS map RETURN map.prop, map.prop + count(*))

Deprecated features

Feature Details

Syntax Deprecated

MATCH (n)-[r:REL]->(m) SET n=r

Use the properties() function instead to get the map of properties of nodes/relationships that can then be used in a SET clause:

MATCH (n)-[r:REL]->(m) SET n=properties(r)

Syntax Deprecated

MATCH (a), (b), allShortestPaths((a)-[r]->(b)) RETURN b

MATCH (a), (b), shortestPath((a)-[r]->(b)) RETURN b

shortestPath and allShortestPaths without variable-length relationship are deprecated. Instead, use a MATCH with a LIMIT of 1 or:

MATCH (a), (b), shortestPath((a)-[r*1..1]->(b)) RETURN b

Syntax Deprecated

CREATE DATABASE databaseName.withDot ...

Creating a database with unescaped dots in the name has been deprecated, instead escape the database name:

CREATE DATABASE `databaseName.withDot` ...

Updated features

Feature Details

Functionality Updated

CREATE INDEX ...

The default index type is changed from B-tree to range index.

Functionality Updated

SHOW INDEXES

The new column owningConstraint was added and will be returned by default from now on. It will list the name of the constraint that the index is associated with or null, in case it is not associated with any constraint.

Functionality Updated

SHOW CONSTRAINTS

The new column ownedIndex was added and will be returned by default from now on. It will list the name of the index associated with the constraint or null, in case no index is associated with it.

Functionality Updated

SHOW TRANSACTIONS YIELD *

New columns for the current query are added:

  • currentQueryStartTime

  • currentQueryStatus

  • currentQueryActiveLockCount

  • currentQueryElapsedTime

  • currentQueryCpuTime

  • currentQueryWaitTime

  • currentQueryIdleTime

  • currentQueryAllocatedBytes

  • currentQueryPageHits

  • currentQueryPageFaults

These columns are only returned in the full set (with YIELD) and not by default.

Functionality Updated

TERMINATE TRANSACTIONS transaction-id[,...]
YIELD { * | field[, ...] }
[ORDER BY field[, ...]]
[SKIP n]
[LIMIT n]
[WHERE expression]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]

Terminate transaction now allows YIELD. The WHERE clause is not allowed on its own, as it is for SHOW, but needs the YIELD clause.

Functionality Updated

SHOW TRANSACTIONS [transaction-id[,...]]
TERMINATE TRANSACTIONS transaction-id[,...]

transaction-id now allows general expressions resolving to a string or a list of strings instead of just parameters.

Functionality Updated

SHOW TRANSACTIONS [transaction-id[,...]]
YIELD field[, ...]
  [ORDER BY field[, ...]]
  [SKIP n]
  [LIMIT n]
  [WHERE expression]
TERMINATE TRANSACTIONS transaction-id[,...]
YIELD field[, ...]
  [ORDER BY field[, ...]]
  [SKIP n]
  [LIMIT n]
  [WHERE expression]
RETURN field[, ...]
  [ORDER BY field[, ...]]
  [SKIP n]
  [LIMIT n]

The SHOW and TERMINATE TRANSACTIONS commands can be combined in the same query. The query does not require a specific order and there can be zero or more of each command type, however at least one command is needed.

When the command is not in standalone mode, the YIELD and RETURN clauses are mandatory. YIELD * is not allowed.

transaction-id is a comma-separated list of one or more quoted strings. It could also be an expression resolving to a string or a list of strings (for example the output column from SHOW).

Functionality Updated

GRANT EXECUTE BOOSTED PROCEDURE ...
GRANT EXECUTE BOOSTED FUNCTION ...

Not a syntax change but a semantic one. The EXECUTE BOOSTED privilege will no longer include an implicit EXECUTE privilege when granted. That means that to execute a procedure or a function with boosted privileges both EXECUTE and EXECUTE BOOSTED are needed.

Functionality Updated

[GRANT|DENY] [IMMUTABLE] ...

Privileges can be specified as IMMUTABLE, which means that they cannot be altered by users with Privilege Management. They can only be administered with auth disabled.

Functionality Updated

REVOKE [IMMUTABLE] ...

IMMUTABLE can now be specified with the REVOKE command to specify that only immutable privileges should be revoked.

Functionality Updated

SHOW DATABASES

Changes to the default columns in the result:

  • The writer, type, and constituents columns have been added.

  • The values returned in the role column have changes to be just primary, secondary, or unknown.

  • The error column has been renamed to statusMessage.

The following columns have been added to the full result set (with YIELD) and not by default:

  • creationTime

  • lastStartTime

  • lastStopTime

  • store

  • currentPrimariesCount

  • currentSecondariesCount

  • requestedPrimariesCount

  • requestedSecondariesCount

Functionality Updated

MATCH (n)
RETURN
CASE n.prop
    WHEN null THEN 'one'
    ELSE 'two'
END

Previously, if n.prop is null, 'one' would be returned. Now, 'two' is returned.

This is a semantic change only. Since null = null returns false in Cypher, a WHEN expression no longer matches on null.

If matching on null is required, please use IS NULL instead:

MATCH (n)
RETURN
CASE
    WHEN n.prop IS NULL THEN 'one'
    ELSE 'two'
END

Functionality Updated

RETURN round(val, precision)

Rounding infinity and NaN values will now return the original value instead of returning an integer approximation for precision 0 and throwing an exception for precision > 0:

old value new value

round(Inf)

9223372036854776000.0

Inf

round(Inf, 1)

exception

Inf

round(NaN)

0

NaN

round(Inf, 1)

exception

NaN

To get an integer value use the toInteger function.

Functionality Updated

CREATE TEXT INDEX ...
MATCH ... WHERE n.prop < 42 ...

Text indexes no longer support finding entries using comparison operators like <, <=, >=, >.

Functionality Updated

CREATE [OR REPLACE] ALIAS compositeDatabase.aliasName ...
ALTER ALIAS compositeDatabase.aliasName
DROP ALIAS compositeDatabase.aliasName

The alias commands can now handle aliases in composite databases.

Syntax Updated

SHOW ALIAS[ES] aliasName FOR DATABASE[S]
SHOW ALIAS[ES] compositeDatabase.aliasName FOR DATABASE[S]

SHOW ALIAS now allows for easy filtering on alias name.

New features

Feature Details

Functionality New

CREATE [OR REPLACE] COMPOSITE DATABASE databaseName [IF NOT EXISTS] [WAIT [n [SEC[OND[S]]]]|NOWAIT]
DROP COMPOSITE DATABASE databaseName [IF EXISTS] [DUMP DATA | DESTROY DATA] [WAIT [n [SEC[OND[S]]]]|NOWAIT]

New Cypher command for creating and dropping composite databases.

Functionality New
New privilege:

CREATE COMPOSITE DATABASE
DROP COMPOSITE DATABASE
COMPOSITE DATABASE MANAGEMENT

New privileges that allow a user to CREATE and/or DROP composite databases.

Syntax Added

1_000_000, 0x_FF_FF, 0o_88_88

Cypher now supports number literals with underscores between digits.

Functionality Added

isNaN(n.prop)

New function which returns whether the given number is NaN. NaN is a special floating point number defined in the Floating-Point Standard IEEE 754. This function was introduced since comparisons including NaN = NaN returns false.

Functionality Added

NaN, Inf, Infinity

Cypher now supports float literals for the values Infinity and NaN. NaN defines a quiet not-a-number value and does not throw any exceptions in arithmetic operations. Both values are implemented according to the Floating-Point Standard IEEE 754.

Functionality Added

COUNT { (n) WHERE n.foo = "bar" }

New expression which returns the number of results of a subquery.

Functionality Added

CREATE DATABASE ... TOPOLOGY n PRIMAR{Y|IES} [m SECONDAR{Y|IES}]

New sub-clause for CREATE DATABASE, to specify the number of servers hosting a database, when creating a database in cluster environments.

Functionality Added

ALTER DATABASE ... SET TOPOLOGY n PRIMAR{Y|IES} [m SECONDAR{Y|IES}]

New sub-clause for ALTER DATABASE, which allows modifying the number of servers hosting a database in cluster environments.

Functionality Added

ENABLE SERVER ...

New Cypher command for enabling servers.

Functionality Added

ALTER SERVER ... SET OPTIONS ...

New Cypher command for setting options for a server.

Functionality Added

RENAME SERVER ... TO ...

New Cypher command for changing the name of a server.

Functionality Added

REALLOCATE DATABASES

New Cypher command for re-balancing what servers host which databases.

Functionality Added

DEALLOCATE DATABASE[S] FROM SERVER[S] ...

New Cypher command for moving all databases from servers.

Functionality Added

DROP SERVER ...

New Cypher command for dropping servers.

Functionality Added

SHOW SERVERS

New Cypher command for listing servers.

Functionality New
New privileges:

SERVER MANAGEMENT
SHOW SERVERS

New privileges that allow a user to create, modify, reallocate, deallocate, drop and list servers.

Syntax New

MATCH (n: A&(B|C)&!D)

New concise syntax for expressing predicates for which labels a node may have, referred to as label expression.

Syntax New

MATCH ()-[r:(!A&!B)]->()

New concise syntax for expressing predicates for which relationship types a relationship may have, referred to as relationship type expression.

Syntax New

MATCH ()-[r:R {prop1: 42} WHERE r.prop2 > 42]->()

New syntax that enables inlining of WHERE clauses inside relationship patterns.

Version 4.4

Deprecated features

Feature Details

Functionality Deprecated

MATCH (n) RETURN n.propertyName_1, n.propertyName_2 + count(*)

Implied grouping keys are deprecated. Only expressions that do not contain aggregations are still considered grouping keys. In expressions that contain aggregations, the leaves must be either:

  • An aggregation

  • A literal

  • A parameter

  • A variable, ONLY IF it is either:
    1) A projection expression on its own (e.g. the n in RETURN n AS myNode, n.value + count(*))
    2) A local variable in the expression (e.g the x in RETURN n, n.prop + size([ x IN range(1, 10) | x ])

  • Property access, ONLY IF it is also a projection expression on its own (e.g. the n.prop in RETURN n.prop, n.prop + count(*))

  • Map access, ONLY IF it is also a projection expression on its own (e.g. the map.prop in WITH {prop: 2} AS map RETURN map.prop, map.prop + count(*))

Syntax Deprecated

USING PERIODIC COMMIT ...

Replaced by:

CALL {
  ...
} IN TRANSACTIONS

Syntax Deprecated

CREATE (a {prop:7})-[r:R]->(b {prop: a.prop})

CREATE clauses in which a variable introduced in the pattern is also referenced from the same pattern are deprecated.

Syntax Deprecated

CREATE CONSTRAINT ON ... ASSERT ...

Replaced by:

CREATE CONSTRAINT FOR ... REQUIRE ...

Functionality Deprecated

CREATE BTREE INDEX ...

B-tree indexes are deprecated.

B-tree indexes used for string queries are replaced by:

CREATE TEXT INDEX ...

B-tree indexes used for spatial queries are replaced by:

CREATE POINT INDEX ...

B-tree indexes used for general queries or property value types are replaced by:

CREATE RANGE INDEX ...

These new indexes may be combined for multiple use cases.

Functionality Deprecated

CREATE INDEX
...
OPTIONS "{" btree-option: btree-value[, ...] "}"

Functionality Deprecated

SHOW BTREE INDEXES

B-tree indexes are deprecated.

Replaced by:

SHOW {POINT | RANGE | TEXT} INDEXES

Functionality Deprecated

USING BTREE INDEX

B-tree indexes are deprecated.

Replaced by:

USING {POINT | RANGE | TEXT} INDEX

Functionality Deprecated

CREATE CONSTRAINT
...
OPTIONS "{" btree-option: btree-value[, ...] "}"

Node key and uniqueness constraints with B-tree options are deprecated.

Replaced by:

CREATE CONSTRAINT
...
OPTIONS "{" range-option: range-value[, ...] "}"

Constraints used for string properties will also require an additional text index to cover the string queries properly. Constraints used for point properties will also require an additional point index to cover the spatial queries properly.

Functionality Deprecated

distance(n.prop, point({x:0, y:0})

Replaced by:

point.distance(n.prop, point({x:0, y:0})

Functionality Deprecated

point({x:0, y:0}) <= point({x:1, y:1}) <= point({x:2, y:2})

The ability to use the inequality operators <, , >, and >= on spatial points is deprecated. Instead, use:

point.withinBBox(point({x:1, y:1}), point({x:0, y:0}), point({x:2, y:2}))

Functionality Deprecated

MATCH (n)
RETURN
CASE n.prop
    WHEN null THEN 'one'
    ELSE 'two'
END

Currently, if n.prop is null, 'one' would be returned. Since null = null returns false in Cypher, a WHEN expression will no longer match in future versions.

Please use IS NULL instead:

MATCH (n)
RETURN
CASE
    WHEN n.prop IS NULL THEN 'one'
    ELSE 'two'
END

New features

Feature Details

Functionality New

CALL {
  ...
} IN TRANSACTIONS

New clause for evaluating a subquery in separate transactions. Typically used when modifying or importing large amounts of data. See CALL { ... } IN TRANSACTIONS.

Syntax New

CREATE CONSTRAINT FOR ... REQUIRE ...

New syntax for creating constraints, applicable to all constraint types.

Functionality New

CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS]
FOR (n:LabelName)
REQUIRE (n.propertyName_1, …, n.propertyName_n) IS UNIQUE
[OPTIONS "{" option: value[, ...] "}"]

Unique property constraints now allow multiple properties, ensuring that the combination of property values are unique.

Functionality New Deprecated

DROP CONSTRAINT
ON (n:LabelName)
ASSERT (n.propertyName_1, …, n.propertyName_n) IS UNIQUE

Unique property constraints now allow multiple properties.

Replaced by:

DROP CONSTRAINT name [IF EXISTS]

Syntax New

CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS]
FOR ...
REQUIRE ... IS NOT NULL
OPTIONS "{" "}"

Existence constraints now allow an OPTIONS map, however, at this point there are no available values for the map.

Functionality New

CREATE LOOKUP INDEX [index_name] [IF NOT EXISTS]
FOR ... ON ...
OPTIONS "{" option: value[, ...] "}"

Token lookup indexes now allow an OPTIONS map to specify the index provider.

Functionality New

CREATE TEXT INDEX ...

Allows creating text indexes on nodes or relationships with a particular label or relationship type, and property combination. They can be dropped by using their name.

Functionality New

CREATE RANGE INDEX ...

Allows creating range indexes on nodes or relationships with a particular label or relationship type, and properties combination. They can be dropped by using their name.

Functionality New

CREATE CONSTRAINT
...
OPTIONS "{" indexProvider: 'range-1.0' "}"

Allows creating node key and uniqueness constraints backed by range indexes by providing the range index provider in the OPTIONS map.

Functionality New

CREATE POINT INDEX ...

Allows creating point indexes on nodes or relationships with a particular label or relationship type, and property combination. They can be dropped by using their name.

Syntax New
New privilege:

IMPERSONATE

New privilege that allows a user to assume privileges of another one.

Functionality New

SHOW TRANSACTION[S] [transaction-id[,...]]
[YIELD { * | field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
[WHERE expression]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]

List transactions on the current server.

The transaction-id is a comma-separated list of one or more quoted strings, a string parameter, or a list parameter.

This replaces the procedures dbms.listTransactions and dbms.listQueries.

Functionality New

TERMINATE TRANSACTION[S] transaction-id[,...]

Terminate transactions on the current server.

The transaction-id is a comma-separated list of one or more quoted strings, a string parameter, or a list parameter.

This replaces the procedures dbms.killTransaction, dbms.killTransactions, dbms.killQuery, and dbms.killQueries.

Functionality New

ALTER DATABASE ...  [IF EXISTS]
SET ACCESS {READ ONLY | READ WRITE}

New Cypher command for modifying a database by changing its access mode.

Functionality New
New privilege:

ALTER DATABASE

New privilege that allows a user to modify databases.

Functionality New
New privilege:

SET DATABASE ACCESS

New privilege that allows a user to modify database access mode.

Functionality New

CREATE ALIAS ... [IF NOT EXISTS]
FOR DATABASE ...

New Cypher command for creating an alias for a database name. Remote aliases are only supported from version 4.4.8.

Functionality New

CREATE OR REPLACE ALIAS ...
FOR DATABASE ...

New Cypher command for creating or replacing an alias for a database name. Remote aliases are only supported from version 4.4.8.

Functionality New

ALTER ALIAS ... [IF EXISTS]
SET DATABASE ...

New Cypher command for altering an alias. Remote aliases are only supported from version 4.4.8.

Functionality New

DROP ALIAS ... [IF EXISTS] FOR DATABASE

New Cypher command for dropping a database alias.

Functionality New

SHOW ALIASES FOR DATABASE

New Cypher command for listing database aliases. Only supported since version 4.4.8.

Functionality New
New privilege:

ALIAS MANAGEMENT

New privilege that allows a user to create, modify, delete and list aliases. Only supported since version 4.4.8.

Functionality New
New privilege:

CREATE ALIAS

New privilege that allows a user to create aliases. Only supported since version 4.4.8.

Functionality New
New privilege:

ALTER ALIAS

New privilege that allows a user to modify aliases. Only supported since version 4.4.8.

Functionality New
New privilege:

DROP ALIAS

New privilege that allows a user to delete aliases. Only supported since version 4.4.8.

Functionality New
New privilege:

SHOW ALIAS

New privilege that allows a user to show aliases. Only supported since version 4.4.8.

Syntax New

MATCH (n:N {prop1: 42} WHERE n.prop2 > 42)

New syntax that enables inlining of WHERE clauses inside node patterns.

Version 4.3

Deprecated features

Feature Details

Syntax Deprecated

CREATE CONSTRAINT [name]
ON (node:Label)
ASSERT exists(node.property)

Replaced by:

CREATE CONSTRAINT [name]
ON (node:Label)
ASSERT node.property IS NOT NULL

Syntax Deprecated

CREATE CONSTRAINT [name]
ON ()-[rel:REL]-()
ASSERT exists(rel.property)

Replaced by:

CREATE CONSTRAINT [name]
ON ()-[rel:REL]-()
ASSERT rel.property IS NOT NULL

Syntax Deprecated

exists(prop)

Replaced by:

prop IS NOT NULL

Syntax Deprecated

NOT exists(prop)

Replaced by:

prop IS NULL

Syntax Deprecated
BRIEF [OUTPUT] for SHOW INDEXES and SHOW CONSTRAINTS.

Replaced by default output columns.

Syntax Deprecated
VERBOSE [OUTPUT] for SHOW INDEXES and SHOW CONSTRAINTS.

Replaced by:

YIELD *

Syntax Deprecated

SHOW EXISTS CONSTRAINTS

Replaced by:

SHOW [PROPERTY] EXIST[ENCE] CONSTRAINTS

Still allows BRIEF and VERBOSE but not YIELD or WHERE.

Syntax Deprecated

SHOW NODE EXISTS CONSTRAINTS

Replaced by:

SHOW NODE [PROPERTY] EXIST[ENCE] CONSTRAINTS

Still allows BRIEF and VERBOSE but not YIELD or WHERE.

Syntax Deprecated

SHOW RELATIONSHIP EXISTS CONSTRAINTS

Replaced by:

SHOW RELATIONSHIP [PROPERTY] EXIST[ENCE] CONSTRAINTS

Still allows BRIEF and VERBOSE but not YIELD or WHERE.

Syntax Deprecated
For privilege commands:

ON DEFAULT DATABASE

Replaced by:

ON HOME DATABASE

Syntax Deprecated
For privilege commands:

ON DEFAULT GRAPH

Replaced by:

ON HOME GRAPH

Syntax Deprecated

MATCH (a) RETURN (a)--()

Pattern expressions producing lists of paths are deprecated, but they can still be used as existence predicates, for example in WHERE clauses. Instead, use a pattern comprehension:

MATCH (a) RETURN [p=(a)--() | p]

Updated features

Feature Details

Functionality Updated

SHOW INDEXES WHERE ...

Now allows filtering for:

SHOW INDEXES

Functionality Updated

SHOW CONSTRAINTS WHERE ...

Now allows filtering for:

SHOW CONSTRAINTS

Functionality Updated

SHOW INDEXES YIELD ...
[WHERE ...]
[RETURN ...]

Now allows YIELD, WHERE, and RETURN clauses to SHOW INDEXES to change the output.

Functionality Updated

SHOW CONSTRAINTS YIELD ...
[WHERE ...]
[RETURN ...]

Now allows YIELD, WHERE, and RETURN clauses to SHOW CONSTRAINTS to change the output.

Syntax Updated

SHOW [PROPERTY] EXIST[ENCE] CONSTRAINTS

New syntax for filtering SHOW CONSTRAINTS on property existence constraints.
Allows YIELD and WHERE but not BRIEF or VERBOSE.

Syntax Updated

SHOW NODE [PROPERTY] EXIST[ENCE] CONSTRAINTS

New syntax for filtering SHOW CONSTRAINTS on node property existence constraints.
Allows YIELD and WHERE but not BRIEF or VERBOSE.

Syntax Updated

SHOW REL[ATIONSHIP] [PROPERTY] EXIST[ENCE] CONSTRAINTS

New syntax for filtering SHOW CONSTRAINTS on relationship property existence constraints.
Allows YIELD and WHERE but not BRIEF or VERBOSE.

Functionality Updated

SHOW FULLTEXT INDEXES

Now allows easy filtering for SHOW INDEXES on fulltext indexes.
Allows YIELD and WHERE but not BRIEF or VERBOSE.

Functionality Updated

SHOW LOOKUP INDEXES

Now allows easy filtering for SHOW INDEXES on token lookup indexes.
Allows YIELD and WHERE but not BRIEF or VERBOSE.

New features

Feature Details

Syntax New

CREATE DATABASE ...
[OPTIONS {...}]

New syntax to pass options to CREATE DATABASE. This can be used to specify a specific cluster node to seed data from.

Syntax New

CREATE CONSTRAINT [name]
ON (node:Label)
ASSERT node.property IS NOT NULL

New syntax for creating node property existence constraints.

Syntax New

CREATE CONSTRAINT [name]
ON ()-[rel:REL]-()
ASSERT rel.property IS NOT NULL

New syntax for creating relationship property existence constraints.

Syntax New

ALTER USER name IF EXISTS ...

Makes altering users idempotent. If the specified name does not exists, no error is thrown.

Syntax New

ALTER USER ...
SET HOME DATABASE ...

Now allows setting home database for user.

Syntax New

ALTER USER ...
REMOVE HOME DATABASE

Now allows removing home database for user.

Syntax New

CREATE USER ...
SET HOME DATABASE ...

CREATE USER now allows setting home database for user.

Syntax New

SHOW HOME DATABASE

New syntax for showing the home database of the current user.

Syntax New
New privilege:

SET USER HOME DATABASE

New Cypher command for administering privilege for changing users home database.

Syntax New
For privilege commands:

ON HOME DATABASE

New syntax for privileges affecting home database.

Syntax New
For privilege commands:

ON HOME GRAPH

New syntax for privileges affecting home graph.

Syntax New

CREATE FULLTEXT INDEX ...

Allows creating fulltext indexes on nodes or relationships. They can be dropped by using their name.

Functionality New

CREATE INDEX FOR ()-[r:TYPE]-() ...

Allows creating indexes on relationships with a particular relationship type and property combination. They can be dropped by using their name.

Functionality New

CREATE LOOKUP INDEX ...

Create token lookup index for nodes with any labels or relationships with any relationship type. They can be dropped by using their name.

Functionality New

RENAME ROLE

New Cypher command for changing the name of a role.

Functionality New

RENAME USER

New Cypher command for changing the name of a user.

Functionality New

SHOW PROCEDURE[S]
[EXECUTABLE [BY {CURRENT USER | username}]]
[YIELD ...]
[WHERE ...]
[RETURN ...]

New Cypher commands for listing procedures.

Functionality New

SHOW [ALL | BUILT IN | USER DEFINED] FUNCTION[S]
[EXECUTABLE [BY {CURRENT USER | username}]]
[YIELD ...]
[WHERE ...]
[RETURN ...]

New Cypher commands for listing functions.

Version 4.2

Deprecated features

Feature Details

Syntax Deprecated

0...

Replaced by 0o....

Syntax Deprecated

0X...

Only 0x... (lowercase x) is supported.

Syntax Deprecated

CALL { RETURN 1 }

Unaliased expressions are deprecated in subquery RETURN clauses. Replaced by:

CALL { RETURN 1 AS one }

Updated features

Feature Details

Functionality Updated

SHOW ROLE name PRIVILEGES

Can now handle multiple roles.

SHOW ROLES n1, n2, ... PRIVILEGES

Functionality Updated

SHOW USER name PRIVILEGES

Can now handle multiple users.

SHOW USERS n1, n2, ... PRIVILEGES

Functionality Updated

round(expression, precision)

The round() function can now take an additional argument to specify rounding precision.

Functionality Updated

round(expression, precision, mode)

The round() function can now take two additional arguments to specify rounding precision and rounding mode.

New features

Feature Details

Functionality New

SHOW PRIVILEGES [AS [REVOKE] COMMAND[S]]

Privileges can now be shown as Cypher commands.

Syntax New

DEFAULT GRAPH

New optional part of the Cypher commands for database privileges.

Syntax New

0o...

Cypher now interprets literals with prefix 0o as an octal integer literal.

Syntax New

SET [PLAINTEXT | ENCRYPTED] PASSWORD

For CREATE USER and ALTER USER, it is now possible to set (or update) a password when the plaintext password is unknown, but the encrypted password is available.

Functionality New
New privilege:

EXECUTE

New Cypher commands for administering privileges for executing procedures and user defined functions. See The DBMS EXECUTE privileges.

Syntax New

CREATE [BTREE] INDEX ... [OPTIONS {...}]

Allows setting index provider and index configuration when creating an index.

Syntax New

CREATE CONSTRAINT ... IS NODE KEY [OPTIONS {...}]

Allows setting index provider and index configuration for the backing index when creating a node key constraint.

Syntax New

CREATE CONSTRAINT ... IS UNIQUE [OPTIONS {...}]

Allows setting index provider and index configuration for the backing index when creating a uniqueness constraint.

Syntax New

SHOW CURRENT USER

New Cypher command for showing current logged-in user and roles.

Functionality New

SHOW [ALL | BTREE] INDEX[ES] [BRIEF | VERBOSE [OUTPUT]]

New Cypher commands for listing indexes.

Replaces the procedures db.indexes, db.indexDetails (verbose), and partially db.schemaStatements (verbose).

Functionality New

SHOW [ALL | UNIQUE | NODE EXIST[S] | RELATIONSHIP EXIST[S] | EXIST[S] | NODE KEY] CONSTRAINT[S] [BRIEF | VERBOSE [OUTPUT]]

New Cypher commands for listing constraints.

Replaces the procedures db.constraints and partially db.schemaStatements (verbose).

Functionality New
New privilege:

SHOW INDEX

New Cypher command for administering privilege for listing indexes.

Functionality New
New privilege:

SHOW CONSTRAINT

New Cypher command for administering privilege for listing constraints.

Version 4.1.3

New features

Feature Details

Syntax New

CREATE INDEX [name] IF NOT EXISTS FOR ...

Makes index creation idempotent. If an index with the name or schema already exists no error will be thrown.

Syntax New

DROP INDEX name IF EXISTS

Makes index deletion idempotent. If no index with the name exists no error will be thrown.

Syntax New

CREATE CONSTRAINT [name] IF NOT EXISTS ON ...

Makes constraint creation idempotent. If a constraint with the name or type and schema already exists no error will be thrown.

Syntax New

DROP CONSTRAINT name IF EXISTS

Makes constraint deletion idempotent. If no constraint with the name exists no error will be thrown.

Version 4.1

Restricted features

Feature Details

Functionality Restricted

REVOKE ...

No longer revokes sub-privileges when revoking a compound privilege, e.g. when revoking INDEX MANAGEMENT, any CREATE INDEX and DROP INDEX privileges will no longer be revoked.

Functionality Restricted

ALL DATABASE PRIVILEGES

No longer includes the privileges START DATABASE and STOP DATABASE.

Updated features

Feature Details

Procedure Updated

queryId

The queryId procedure format has changed, and no longer includes the database name. For example, mydb-query-123 is now query-123. This change affects built-in procedures dbms.listQueries(), dbms.listActiveLocks(queryId), dbms.killQueries(queryIds) and dbms.killQuery(queryId).

Functionality Updated

SHOW PRIVILEGES

The returned privileges are a closer match to the original grants and denies, e.g. if granted MATCH the command will show that specific privilege and not the TRAVERSE and READ privileges. Added support for YIELD and WHERE clauses to allow filtering results.

New features

Feature Details

Functionality New
New role:

PUBLIC

The PUBLIC role is automatically assigned to all users, giving them a set of base privileges.

Syntax New
For privileges:

REVOKE MATCH

The MATCH privilege can now be revoked.

Functionality New

SHOW USERS

New support for YIELD and WHERE clauses to allow filtering results.

Functionality New

SHOW ROLES

New support for YIELD and WHERE clauses to allow filtering results.

Functionality New

SHOW DATABASES

New support for YIELD and WHERE clauses to allow filtering results.

Functionality New
TRANSACTION MANAGEMENT privileges

New Cypher commands for administering transaction management.

Functionality New
DBMS USER MANAGEMENT privileges

New Cypher commands for administering user management.

Functionality New
DBMS DATABASE MANAGEMENT privileges

New Cypher commands for administering database management.

Functionality New
DBMS PRIVILEGE MANAGEMENT privileges

New Cypher commands for administering privilege management.

Functionality New

ALL DBMS PRIVILEGES

New Cypher command for administering role, user, database and privilege management.

Functionality New

ALL GRAPH PRIVILEGES

New Cypher command for administering read and write privileges.

Functionality New
Write privileges

New Cypher commands for administering write privileges.

Functionality New

ON DEFAULT DATABASE

New optional part of the Cypher commands for database privileges.

Version 4.0

Removed features

Feature Details

Function Removed

rels()

Replaced by relationships().

Function Removed

toInt()

Replaced by toInteger().

Function Removed

lower()

Replaced by toLower().

Function Removed

upper()

Replaced by toUpper().

Function Removed

extract()

Replaced by list comprehension.

Function Removed

filter()

Replaced by list comprehension.

Functionality Removed
For Rule planner:

CYPHER planner=rule

The RULE planner was removed in 3.2, but still possible to trigger using START or CREATE UNIQUE clauses. Now it is completely removed.

Functionality Removed
Explicit indexes

The removal of the RULE planner in 3.2 was the beginning of the end for explicit indexes. Now they are completely removed, including the removal of the built-in procedures for Neo4j 3.3 to 3.5.

Functionality Removed
For compiled runtime:

CYPHER runtime=compiled

Replaced by the new pipelined runtime which covers a much wider range of queries.

Clause Removed

CREATE UNIQUE

Running queries with this clause will cause a syntax error.

Clause Removed

START

Running queries with this clause will cause a syntax error.

Syntax Removed

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

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

Syntax Removed

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

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

Syntax Removed

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

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

Syntax Removed

{parameter}

Replaced by $parameter.

Deprecated features

Feature Details

Syntax Deprecated

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

As in Cypher 3.2, this is replaced by:

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

Syntax Deprecated

CREATE INDEX ON :Label(prop)

Replaced by CREATE INDEX FOR (n:Label) ON (n.prop).

Syntax Deprecated

DROP INDEX ON :Label(prop)

Replaced by DROP INDEX name.

Syntax Deprecated

DROP CONSTRAINT ON (n:Label) ASSERT (n.prop) IS NODE KEY

Replaced by DROP CONSTRAINT name.

Syntax Deprecated

DROP CONSTRAINT ON (n:Label) ASSERT (n.prop) IS UNIQUE

Replaced by DROP CONSTRAINT name.

Syntax Deprecated

DROP CONSTRAINT ON (n:Label) ASSERT exists(n.prop)

Replaced by DROP CONSTRAINT name.

Syntax Deprecated

DROP CONSTRAINT ON ()-[r:Type]-() ASSERT exists(r.prop)

Replaced by DROP CONSTRAINT name.

Restricted features

Feature Details

Function Restricted

length()

Restricted to only work on paths. See length() for more details.

Function Restricted

size()

No longer works for paths. Only works for strings, lists and pattern expressions. See size() for more details.

Updated features

Feature Details

Syntax Extended

CREATE CONSTRAINT [name] ON ...

The create constraint syntax can now include a name.

The IS NODE KEY and IS UNIQUE versions of this command replace the procedures db.createNodeKey and db.createUniquePropertyConstraint, respectively.

New features

Feature Details

Functionality New
Pipelined runtime:

CYPHER runtime=pipelined

This Neo4j Enterprise Edition only feature involves a new runtime that has many performance enhancements.

Functionality New
Multi-database administration

New Cypher commands for administering multiple databases.

Functionality New
Access control

New Cypher commands for administering role-based access control.

Functionality New
Fine-grained security

New Cypher commands for administering dbms, database, graph and sub-graph access control.

Syntax New

CREATE INDEX [name] FOR (n:Label) ON (n.prop)

New syntax for creating indexes, which can include a name.

Replaces the db.createIndex procedure.

Syntax New

DROP INDEX name

New command for dropping an index by name.

Syntax New

DROP CONSTRAINT name

New command for dropping a constraint by name, no matter the type.

Clause New

WHERE EXISTS {...}

EXISTS subqueries are subclauses used to filter the results of a MATCH, OPTIONAL MATCH, or WITH clause.

Clause New

USE neo4j

New clause to specify which graph a query, or query part, is executed against.

Version 3.5

Deprecated features

Feature Details

Functionality Deprecated
Compiled runtime:

CYPHER runtime=compiled

The compiled runtime will be discontinued in the next major release. It might still be used for default queries in order to not cause regressions, but explicitly requesting it will not be possible.

Function Deprecated

extract()

Replaced by list comprehension.

Function Deprecated

filter()

Replaced by list comprehension.

Version 3.4

Feature Type Change Details

Spatial point types

Functionality

Amendment

A point — irrespective of which Coordinate Reference System is used — can be stored as a property and is able to be backed by an index. Prior to this, a point was a virtual property only.

point() - Cartesian 3D

Function

Added

point() - WGS 84 3D

Function

Added

randomUUID()

Function

Added

Temporal types

Functionality

Added

Supports storing, indexing and working with the following temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration.

Temporal functions

Functionality

Added

Functions allowing for the creation and manipulation of values for each temporal type — Date, Time, LocalTime, DateTime, LocalDateTime and Duration.

Temporal operators

Functionality

Added

Operators allowing for the manipulation of values for each temporal type — Date, Time, LocalTime, DateTime, LocalDateTime and Duration.

toString()

Function

Extended

Now also allows temporal values as input (i.e. values of type Date, Time, LocalTime, DateTime, LocalDateTime or Duration).

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 Neo4j versions 3.3 to 3.5 for accessing explicit indexes. The procedures 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

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

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

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 2D

Function

Added

distance()

Function

Added

User-defined procedures

Functionality

Added

toString()

Function

Extended

Now also allows Boolean values as input