Deprecations, additions and compatibility

Cypher® is a graph query 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 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, partially replaced for now, and will be fully replaced in 5.0 by future indexes. In 4.4, b-tree indexes are still the correct alternative to use.

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

CREATE TEXT INDEX ...

B-tree indexes used for spatial queries will be replaced by:

CREATE POINT INDEX ...

B-tree indexes used for general queries or property value types will be 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, partially replaced for now, and will be fully replaced in 5.0 by future indexes. In 4.4, b-tree indexes are still the correct alternative to use.

Replaced by the new and future index types:

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 and will be replaced in 5.0 by range options, see range indexes. In 4.4, the b-tree index-backed constraints are still the correct alternative to use.

Will be 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, see point indexes.

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 <, <=, >, 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}))

Procedure Deprecated

dbms.listTransactions

Replaced by:

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]]

Procedure Deprecated

dbms.killTransaction
dbms.killTransactions

Replaced by:

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

Procedure Deprecated

dbms.listQueries

Replaced by:

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]]

Procedure Deprecated

dbms.killQuery
dbms.killQueries

Replaced by:

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

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 ...

FUTURE 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' "}"

FUTURE CONSTRAINT: 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 ...

FUTURE 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.

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.

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.