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

Neo4j 5.26

Deprecated features

Feature Details

Functionality Deprecated

CREATE ... INDEX ... OPTIONS { indexProvider: ... }
CREATE ... CONSTRAINTS ... OPTIONS { indexProvider: ... }

Specifying an index provider in the OPTIONS map when creating an index or constraint is deprecated.

This also means that the vector index index provider, vector-1.0, is deprecated. Use the default index provider, vector-2.0, instead.

Functionality Deprecated

MATCH (where {...})
MATCH (...)-[where {...}]->()

The unescaped variable named where (or any casing variant, like WHERE) used in a node or relationship pattern followed directly by a property key-value expression is deprecated. To continue using variables with this name, use backticks to escape the variable name:

  • Node patterns: MATCH (`where` { …​ })

  • Relationship patterns: MATCH (…​)-[`where` { …​ }]→()

Functionality Deprecated

... + n:A
... + n:A&B
... + n:A&B|C

Using an unparenthesized label expression predicate as the right-hand side operand of + is deprecated. Parenthesize the label expression predicate on the right-hand side of +: …​ + (n:A).

Functionality Deprecated

CASE x ... WHEN is :: STRING THEN ... END

Using an unescaped variable named is (or any casing variant, like IS) as a WHEN operand in a simple CASE expression is deprecated. To continue using variables with this name in simple CASE expressions, use backticks to escape the variable name: CASE x …​ WHEN `is` :: STRING THEN …​ END

Functionality Deprecated

CASE x ... WHEN contains + 1 THEN ... END
CASE x ... WHEN contains - 1 THEN ... END

Using an unescaped variable named contains (or any casing variant, like CONTAINS) in addition or subtraction operations within a WHEN operand of a simple CASE expression is deprecated. To continue using variables with this name, use backticks to escape the variable name:

  • Additions: CASE x …​ WHEN `contains` + 1 THEN …​ END

  • Subtractions: CASE x …​ WHEN `contains` - 1 THEN …​ END

Functionality Deprecated

CASE x ... WHEN in[1] THEN ... END
CASE x ... WHEN in["abc"] THEN ... END

Using the [] operator on an unescaped variable named in (or any casing variant, like IN) within a WHEN operand of a simple CASE expression is deprecated. To continue using variables with this name, use backticks to escape the variable name:

  • CASE x …​ WHEN `in`[1] THEN …​ END

  • CASE x …​ WHEN `in`["abc"] THEN …​ END

Functionality Deprecated

CALL db.schema.nodeTypeProperties() YIELD propertyTypes RETURN propertyTypes;
CALL db.schema.relTypeProperties() YIELD propertyTypes RETURN propertyTypes;

The column propertyTypes currently returned by the procedures db.schema.nodeTypeProperties() and db.schema.relTypeProperties() produces a list of strings representing the potential Java types for a given property. In an upcoming major release of Neo4j, this will be updated to represent the possible Cypher types for that property instead. For all available Cypher types, see the section on types and their synonyms.

Functionality Deprecated

CREATE DATABASE db OPTIONS { seedCredentials: ...,  seedConfig: ... }

The CREATE DATABASE option seedCredentials has been deprecated. For seeding from cloud storage, it is recommended to use CloudSeedProvider which will read cloud credentials and configuration from standard locations. For further information, see Managing databases in a cluster → CloudSeedProvider.

Functionality Deprecated

CREATE DATABASE db OPTIONS { storeFormat: 'standard' }

CREATE DATABASE db OPTIONS { storeFormat: 'high_limit' }

The standard and high_limit store formats have been deprecated. Creating databases with these formats is therefore also deprecated. For more information on the deprecation of these formats, see Store formats → Format deprecations.

Updated features

Feature Details

Functionality Updated

CREATE DATABASE foo TOPOLOGY $p PRIMARIES $s SECONDARIES
ALTER DATABASE foo SET TOPOLOGY $p PRIMARIES $s SECONDARIES

The CREATE DATABASE and ALTER DATABASE commands now accept parameters for TOPOLOGY configuration.

Functionality Updated

GRANT READ {*} ON GRAPH * FOR (n) WHERE n.createdAt > date('2024-10-25') TO regularUsers

Property-based access control now supports spatial and temporal values.

Neo4j 5.25

Deprecated features

Feature Details

Functionality Deprecated

CREATE DATABASE db OPTIONS { existingDataSeedInstance: ... }

The CREATE DATABASE option existingDataSeedInstance has been deprecated and replaced with the option existingDataSeedServer. The functionality is unchanged.

Updated features

Feature Details

Functionality Updated

CREATE (n:Label {property: 'name'}),
()-[r:REL_TYPE]->()

Neo4j’s block format now implements GQL’s limit on the maximum length of identifiers.

The maximum limit is set to 16,383 characters in an identifier. This means that node labels, relationship types, and property keys cannot include more than 16,383 characters.

New features

Feature Details

Functionality New

CREATE DATABASE db OPTIONS { existingDataSeedServer: ... }

The option existingDataSeedServer has been added to CREATE DATABASE. The functionality is the same as the deprecated option existingDataSeedServer, which this replaces.

Neo4j 5.24

New features

Feature Details

Functionality New

MATCH (t:Team)
OPTIONAL CALL (t) {
  MATCH (p:Player)-[:PLAYS_FOR]->(t)
  RETURN collect(p) as players
}
RETURN t AS team, players
OPTIONAL CALL db.labels() YIELD label
RETURN label

Introduced OPTIONAL CALL for optionally executing a procedure or subquery CALL. Similar to OPTIONAL MATCH, any empty rows produced by the OPTIONAL CALL will return null and not affect the remainder of the procedure or subquery evaluation.

Functionality New

MATCH (n)
RETURN n.name AS names OFFSET 2

Introduced OFFSET, a GQL conformant synonym to SKIP.

See OFFSET as a synonym for SKIP for details.

Functionality New

MATCH (n)
ORDER BY n.name DESC
OFFSET 3
LIMIT 2
RETURN collect(n.name) AS names

Introduced GQL conformant standalone ORDER BY, SKIP/OFFSET, and LIMIT clauses.

Functionality New

SET n:$(label)
REMOVE n:$(label)

Added the ability to dynamically reference labels in SET and REMOVE clauses.

Functionality New

SET n[$prop] = "hello world"
REMOVE n[$prop]

Added the ability to dynamically reference properties in SET and REMOVE clauses.

Functionality New

DROP [COMPOSITE] DATABASE ... [RESTRICT | CASCADE ALIAS[ES]]

Added the ability to drop database aliases while deleting a database. This will affect local database aliases targeting the database and constituent database aliases belonging to the composite database. For more information, see Delete a database with local database aliases targeting it and Delete a composite database with constituent database aliases.

Functionality New

LOAD CSV FROM 'azb://azb-account/azb-container/artists.csv' AS row
MERGE (a:Artist {name: row[1], year: toInteger(row[2])})
RETURN a.name, a.year

Extension of the LOAD CSV clause to allow loading CSV files from Azure Cloud Storage URIs.

Functionality New

CREATE USER bob
SET AUTH 'externalProviderName' {
  SET ID 'userIdForExternalProvider'
}
SET AUTH 'native' {
  SET PASSWORD 'password'
  SET PASSWORD CHANGE REQUIRED
}

Added the ability set which auth providers apply to a user (Enterprise Edition).

Administration of the native (username / password) auth via the new syntax is also now supported (Community Edition).

Functionality New

ALTER USER bob
REMOVE AUTH 'native'
SET AUTH 'externalProviderName' {
  SET ID 'userIdForExternalProvider'
}

Added the ability add and remove user auth providers via the ALTER USER command.

Setting the native (username / password) auth provider via this new syntax is also supported (Community Edition), but removing any auth provider or setting a non-native auth provider is only supported in Enterprise Edition.

Functionality New

SHOW USERS WITH AUTH

New support for WITH AUTH to allow display users' auth providers with a separate row per user per auth provider.

Functionality New

SET AUTH

New privilege that allows a user to modify user auth providers. This is a sub-privilege of the ALTER USER privilege. Like all GRANT/DENY commands this is only available in Enterprise Edition.

Neo4j 5.23

Deprecated features

Feature Details

Functionality Deprecated

UNWIND [0, 1, 2] AS x
CALL {
  WITH x
  RETURN x * 10 AS y
}
RETURN x, y

Using the WITH clause to import variables to CALL subqueries is deprecated, and replaced with a variable scope clause. It is also deprecated to use naked subqueries without a variable scope clause.

Updated features

Feature Details

Functionality Updated

RETURN datetime.statement() IS :: TIMESTAMP WITH TIME ZONE

Introduced new GQL conformant aliases to duration types: TIMESTAMP WITHOUT TIME ZONE (alias to LOCAL DATETIME), TIME WITHOUT TIME ZONE (alias to LOCAL TIME), TIMESTAMP WITH TIME ZONE (alias to ZONED DATETIME), and TIME WITH TIME ZONE (alias to ZONED TIME).

See types and their synonyms for more.

New features

Feature Details

Functionality New

UNWIND [0, 1, 2] AS x
CALL (x) {
   RETURN x * 10 AS y
}
RETURN x, y

Introduced a new variable scope clause to import variables in CALL subqueries.

Functionality New

CREATE VECTOR INDEX moviePlots IF NOT EXISTS
FOR (m:Movie)
ON m.embedding
OPTIONS {indexConfig: {
`vector.quantization.enabled`: true
`vector.hnsw.m`: 16,
`vector.hnsw.ef_construction`: 100,
}}

Introduced the following configuration settings for vector indexes:

  • vector.quantization.enabled: allows for enabling quantization, which can accelerate search performance but can also slightly decrease accuracy.

  • vector.hnsw.m: controls the maximum number of connections each node has in the index’s internal graph.

  • vector.hnsw.ef_construction: sets the number of nearest neighbors tracked during the insertion of vectors into the index’s internal graph.

Additionally, as of Neo4j 5.23, it is no longer mandatory to configure the settings vector.dimensions and vector.similarity_function when creating a vector index.

Neo4j 5.21

Updated features

Feature Details

Functionality Updated

SHOW FUNCTIONS YIELD *
SHOW PROCEDURES YIELD *

Introduced a deprecatedBy column to SHOW FUNCTIONS and SHOW PROCEDURES. It is not returned by default in either command.

The column is a STRING value specifying a replacement function/procedure if the used function/procedure is deprecated. Otherwise, it returns null.

New features

Feature Details

Functionality New

GRANT READ {*} ON GRAPH * FOR (n) WHERE n.securityLevel > 3 TO regularUsers
GRANT TRAVERSE ON GRAPH * FOR (n:Email) WHERE n.classification IS NULL TO regularUsers
DENY MATCH {*} ON GRAPH * FOR (n) WHERE n.classification <> 'UNCLASSIFIED' TO regularUsers

Introduction of property-based access control for read privileges. The ability to read, traverse and match nodes based on node property values is now supported in Enterprise Edition.

Functionality New

LOAD CSV FROM 'gs://gs-bucket/artists.csv' AS row
MERGE (a:Artist {name: row[1], year: toInteger(row[2])})
RETURN a.name, a.year

Extension of the LOAD CSV clause to allow loading CSV files from Google Cloud Storage URIs.

Functionality New

CYPHER inferSchemaParts=most_selective_label

Introduction of inferSchemaParts, a new Cypher query option that controls the extent to which the Cypher planner will infer predicates.

Functionality New

RETURN upper('abc'), lower('ABC')

Introduction of a lower() and upper() function. These are aliases of the toLower() and toUpper() functions.

Functionality New

UNWIND range(1, 10) as i
  CALL {
    WITH i
    CREATE (n:N { i: i })
} IN 3 CONCURRENT TRANSACTIONS OF 2 ROWS

Introduced CALL { …​ } IN CONCURRENT TRANSACTIONS, which uses multiple CPU processors simultaneously to execute batched inner transactions concurrently.

Functionality New

MATCH SHORTEST 1 (:A)-[:R]->{0,10}(:B)
MATCH p = ANY 2 (:A)-[:R]->{0,10}(:B)
MATCH ALL SHORTEST (:A)-[:R]->{0,10}(:B)
MATCH SHORTEST 2 GROUPS (:A)-[:R]->{0,10}(:B)

Introduced new graph pattern matching keywords to find variations of the shortest paths between nodes.

Functionality New

New operators:

Introduced new operators to solve SHORTEST queries.

Neo4j 5.20

Deprecated features

Feature Details

Functionality Deprecated

MERGE (a {foo:1})-[:T]->(b {foo:a.foo})

Merging a node or relationship entity, and then referencing that entity in a property definition in the same MERGE clause is deprecated. Split the MERGE clause into two separate clauses instead.

New features

Feature Details

Syntax Functionality New

RETURN trim(BOTH 'x' FROM 'xxhelloxx'),
       ltrim('xxhello', 'x'),
       rtrim('helloxx', 'x'),
       btrim('xxhelloxx', 'x')

Introduced btrim() function, which returns the given STRING with leading and trailing trimCharacterString characters removed. Also extended the trim(), ltrim(), and rtrim() functions to accept alternative trim character strings.

Neo4j 5.19

New features

Feature Details

Functionality New

RETURN "Hello" || " " || "World";

RETURN [1, 2] || [3, 4, 5];

Added a new STRING and LIST concatenation operator.

Functionality New

FINISH

New FINISH clause, which can be optionally used to define a query that returns no result.

Functionality New

RETURN 1 AS a
UNION DISTINCT
RETURN 1 AS a

The keyword DISTINCT can now be added after a UNION as the explicit form of a UNION with duplicate removal.

Functionality New

LOAD CSV FROM 's3://artists.csv' AS row
MERGE (a:Artist {name: row[1], year: toInteger(row[2])})
RETURN a.name, a.year

Extension of the LOAD CSV clause to allow loading CSV files from AWS S3 URIs.

Functionality New

  • "textembedding-gecko@002"

  • "textembedding-gecko@003"

  • "textembedding-gecko-multilingual@001"

Added support for additional Vertex AI vector encoding models. Also added support for Vertex AI taskType and title embedding parameters.

Neo4j 5.18

New features

Feature Details

Functionality New

INSERT

Added a new keyword INSERT, which can be used as a synonym to CREATE for creating nodes and relationships.

Functionality New

MATCH (n)
RETURN CASE n.prop
        WHEN IS NULL THEN "Null"
        WHEN < 0 THEN "Negative"
        WHEN 2, 4, 6, 8 THEN "Even"
        ELSE "Odd"
        END

Extension of the simple CASE expression, allowing multiple matching values to be comma-separated in the same WHEN statement. The simple CASE uses an implied equals (=) comparator, and this extension additionally allows other comparison predicates to be explicitly specified before the matching value in an extended version of the simple CASE.

Functionality New

CREATE VECTOR INDEX [index_name] [IF NOT EXISTS]
FOR ()-[r:REL_TYPE]-() ON (r.property)
OPTIONS {indexConfig: {
 `vector.dimensions`: $dimension,
 `vector.similarity_function`: $similarityFunction
}}

Added command to create relationship vector indexes. The index configuration settings vector.dimensions and vector.similarity_function are mandatory when using this command. The command allows for the IF NOT EXISTS flag to skip index creation should the index already exist.

Functionality New

RETURN vector.similarity.euclidean(a, b)
RETURN vector.similarity.cosine(a, b)

Introduction of vector similarity functions. These functions return a FLOAT representing the similarity of vectors a and b.

Neo4j 5.17

Updated features

Feature Details

Functionality Updated

CREATE [index_type] INDEX [index_name] IF NOT EXISTS FOR ...

When attempting to create an index using IF NOT EXISTS with either the same name or same index type and schema, or both, as an existing index the command now returns a notification showing the existing index which blocks the creation.

Functionality Updated

CREATE CONSTRAINT [constraint_name] IF NOT EXISTS FOR ...

When attempting to create a constraint using IF NOT EXISTS with either the same name or same constraint type and schema (and property type for property type constraints), or both, as an existing constraint the command now returns a notification showing the existing constraint which blocks the creation.

Functionality Updated

DROP CONSTRAINT constraint_name IF EXISTS

When attempting to drop a non-existing index using IF EXISTS the command will now return a notification about the index not existing.

Functionality Updated

DROP INDEX index_name IF EXISTS

When attempting to drop a non-existing constraint using IF EXISTS the command will now return a notification about the constraint not existing.

New features

Feature Details

Functionality New

RETURN normalize("string", NFC)

Introduction of a normalize() function. This function normalizes a STRING according to the specified normalization form, which can be of type NFC, NFD, NFKC, or NFKD.

Functionality New

IS [NOT] [NFC | NFD | NFKC | NFKD] NORMALIZED
RETURN "string" IS NORMALIZED

Introduction of an IS NORMALIZED operator. The operator can be used to check if a STRING is normalized according to the specified normalization form, which can be of type NFC, NFD, NFKC, or NFKD.

Introduction of partitioned operators used by the parallel runtime. These operators segment the data and operate on each segment in parallel

Neo4j 5.16

Updated features

Feature Details

Functionality Updated

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

DROP INDEX $name [IF EXISTS]

Added the ability to use parameters for the index name in the CREATE and DROP commands.

Functionality Updated

CREATE CONSTRAINT $name [IF NOT EXISTS] FOR ...

DROP CONSTRAINT $name [IF EXISTS]

Added the ability to use parameters for the constraint name in the CREATE and DROP commands.

New features

Feature Details

Functionality New

GRANT LOAD ON CIDR "127.0.0.1/32" TO role
DENY LOAD ON CIDR "::1/128" TO role

Added the ability to grant or deny LOAD privilege on a CIDR range. For more information, see the Operations Manual → The CIDR privilege.

Neo4j 5.15

Deprecated features

Feature Details

Functionality Deprecated

RETURN 1 as my\u0085identifier

The Unicode character `\u0085` is deprecated for unescaped identifiers and will be considered as a whitespace character in the future. To continue using it, escape the identifier by adding backticks around the identifier. This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names or parameters. In the given example, the quoted identifier would be `my�identifier`.

Functionality Deprecated

RETURN 1 as my$Identifier

The character with the Unicode representation `\u0024` is deprecated for unescaped identifiers and will not be supported in the future. To continue using it, escape the identifier by adding backticks around the identifier. This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names or parameters. In the given example, the quoted identifier would be `my$identifier`.

The following Unicode Characters are deprecated in identifiers: '\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', '\u0008', '\u000E', '\u000F', '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001A', '\u001B', '\u007F', '\u0080', '\u0081', '\u0082', '\u0083', '\u0084', '\u0086', '\u0087', '\u0088', '\u0089', '\u008A', '\u008B', '\u008C', '\u008D', '\u008E', '\u008F', '\u0090', '\u0091', '\u0092', '\u0093', '\u0094', '\u0095', '\u0096', '\u0097', '\u0098', '\u0099', '\u009A', '\u009B', '\u009C', '\u009D', '\u009E', '\u009F', '\u0024', '\u00A2', '\u00A3', '\u00A4', '\u00A5', '\u00AD', '\u0600', '\u0601', '\u0602', '\u0603', '\u0604', '\u0605', '\u061C', '\u06DD', '\u070F', '\u08E2', '\u180E', '\u200B', '\u200C', '\u200D', '\u200E', '\u200F', '\u202A', '\u202B', '\u202C', '\u202D', '\u202E', '\u2060', '\u2061', '\u2062', '\u2063', '\u2064', '\u2066', '\u2067', '\u2068', '\u2069', '\u206A', '\u206B', '\u206C', '\u206D', '\u206E', '\u206F', '\u2E2F', '\uFEFF', '\uFFF9', '\uFFFA', '\uFFFB'

Updated features

Feature Details

Functionality Updated

SHOW VECTOR INDEXES

Extended SHOW INDEXES with easy filtering for vector indexes. This is equivalent to SHOW INDEXES WHERE type = 'VECTOR'.

Functionality Updated

MATCH (n:Label) WHERE $param IS :: STRING NOT NULL AND n.prop = $param

IS :: STRING NOT NULL is now an index-compatible predicate.

New features

Feature Details

Functionality New

MATCH (n)
RETURN count(ALL n.prop)

Added a new keyword ALL, explicitly defining that the aggregate function is not DISTINCT. This is a mirror of the already existing keyword DISTINCT for functions.

Functionality New

CREATE VECTOR INDEX [index_name] [IF NOT EXISTS]
FOR (n: Label) ON (n.property)
OPTIONS {indexConfig: {
 `vector.dimensions`: $dimension,
 `vector.similarity_function`: $similarityFunction
}}

Added command to create node vector indexes, replacing the db.index.vector.createNodeIndex procedure. The index configuration settings vector.dimensions and vector.similarity_function are mandatory when using this command. The command allows for the IF NOT EXISTS flag to skip index creation should the index already exist.

Neo4j 5.14

Updated features

Feature Details

Functionality Updated

IS :: INTEGER!

Extended type syntax to allow an exclamation mark ! as a synonym for NOT NULL.

New features

Feature Details

Functionality New

RETURN nullIf(v1, v2)

Introduction of a nullIf() function. This function returns null if the two given parameters are equivalent, otherwise returns the value of the first parameter.

Functionality New

MATCH (n) NODETACH DELETE n

Added a new keyword NODETACH, explicitly defining that relationships will not be detached and deleted. This is a mirror of the already existing keyword DETACH.

Neo4j 5.13

Updated features

Feature Details

Functionality Updated

SHOW FUNCTIONS YIELD *
SHOW PROCEDURES YIELD *

Updated the signatures column in SHOW FUNCTIONS and SHOW PROCEDURES.

Procedure signatures now follow the pattern: "procedureName(param1 :: TYPE, param2 :: TYPE, .., paramN :: TYPE) :: (returnParam1 :: TYPE, returnParam2, .., returnParamN :: TYPE)"

The signature for procedures with no return columns now follows the pattern: "procedureName(param1 :: TYPE, param2 :: TYPE, .., paramN :: TYPE)"

Function signatures now follow the pattern: "functionName(param1 :: TYPE, param2 :: TYPE, .., paramN :: TYPE) :: TYPE"

For all available Cypher types, see the section on types and their synonyms.

New features

Feature Details

Functionality New Beta

CALL cdc.current()
CALL cdc.earliest()
CALL cdc.query(from, selectors)

Introduction of the Change Data Capture (CDC) feature. For details, see Change Data Capture.

Functionality New

RETURN valueType(expr)

Introduction of a valueType() function. This function returns a STRING representation of the most precise value type that the given expression evaluates to.

Functionality New

RETURN char_length(expr)

Introduction of a char_length() function. This function returns the number of Unicode characters in a STRING. It is an alias of the size() function.

Functionality New

RETURN character_length(expr)

Introduction of a character_length() function. This function returns the number of Unicode characters in a STRING. It is an alias of the size() function.

Functionality New

New privilege:

GRANT LOAD ON ALL DATA TO `role`

New privilege that controls a user’s ability to load data. Unlike other privileges, these are not granted, denied, or revoked on graphs, databases, or the DBMS, but instead on ALL DATA.

Functionality New

USE graph.byElementId(elementId :: STRING)

New graph function, graph.byElementId(), that resolves the constituent graph to which a given element id belongs.

Functionality New

CYPHER runtime = parallel

Introduction of the parallel runtime. This runtime is designed for analytical, graph-global read queries run on machines with several available CPUs.

Neo4j 5.12

New features

Feature Details

Functionality New

db.nameFromElementId(elementId :: STRING) :: STRING

New database function to return database names from element ids.

Neo4j 5.11

Updated features

Feature Details

Functionality Updated

SHOW ALIASES

Introduced a new column composite to SHOW ALIASES. This column is returned by default.

The column returns the name of the composite database that the alias belongs to, or null if the alias does not belong to a composite database.

Functionality Updated

IS [NOT] :: <TYPE>

Extended type predicate expressions. Closed dynamic union types (type1 | type2 | …​) are now supported. For example, the following query which evaluates to true if a value is either of type INTEGER or FLOAT:

IS :: INTEGER | FLOAT

Functionality Updated

CREATE CONSTRAINT name FOR (n:Label) REQUIRE n.prop IS :: <PROPERTY TYPE>

CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS :: <PROPERTY TYPE>

Extended node and relationship property type constraints. Closed dynamic union types (type1 | type2 | …​) are now supported, allowing for types such as:

  • INTEGER | FLOAT

  • LIST<STRING NOT NULL> | STRING

  • ZONED DATETIME | LOCAL DATETIME

Functionality Updated

ALTER CURRENT USER
SET PASSWORD FROM 'password1' TO 'password2'

This command now auto-commits even when executed inside an explicit transaction.

Neo4j 5.10

Updated features

Feature Details

Functionality Updated

IS [NOT] :: <TYPE>

Extended type predicate expressions. The newly supported types are:

  • NOTHING

  • NULL

  • BOOLEAN NOT NULL

  • STRING NOT NULL

  • INTEGER NOT NULL

  • FLOAT NOT NULL

  • DATE NOT NULL

  • LOCAL TIME NOT NULL

  • ZONED TIME NOT NULL

  • LOCAL DATETIME NOT NULL

  • ZONED DATETIME NOT NULL

  • DURATION NOT NULL

  • POINT NOT NULL

  • NODE

  • NODE NOT NULL

  • RELATIONSHIP

  • RELATIONSHIP NOT NULL

  • MAP

  • MAP NOT NULL

  • LIST<TYPE>

  • LIST<TYPE> NOT NULL

  • PATH

  • PATH NOT NULL

  • PROPERTY VALUE

  • PROPERTY VALUE NOT NULL

  • ANY

  • ANY NOT NULL

Functionality Updated

CREATE CONSTRAINT name FOR (n:Label) REQUIRE n.prop IS :: <PROPERTY TYPE>

CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS :: <PROPERTY TYPE>

Extended node and relationship property type constraints. The new supported types are:

  • LIST<BOOLEAN NOT NULL>

  • LIST<STRING NOT NULL>

  • LIST<INTEGER NOT NULL>

  • LIST<FLOAT NOT NULL>

  • LIST<DATE NOT NULL>

  • LIST<LOCAL TIME NOT NULL>

  • LIST<ZONED TIME NOT NULL>

  • LIST<LOCAL DATETIME NOT NULL>

  • LIST<ZONED DATETIME NOT NULL>

  • LIST<DURATION NOT NULL>

  • LIST<POINT NOT NULL>

Neo4j 5.9

Deprecated features

Feature Details

Functionality Deprecated

CREATE (a {foo:1}), (b {foo:a.foo})

Creating a node or relationship entity, and then referencing that entity in a property definition in the same CREATE clause is deprecated. Split the CREATE clause into two separate clauses instead.

Updated features

Feature Details

Functionality Updated

SHOW SETTINGS YIELD *
SHOW FUNCTIONS YIELD *
SHOW PROCEDURES YIELD *

Introduced an isDeprecated column to SHOW SETTINGS, SHOW FUNCTIONS, and SHOW PROCEDURES. It is not returned by default in either command.

The column is true if the setting/function/procedure is deprecated and false otherwise.

Functionality Updated

SHOW FUNCTIONS YIELD argumentDescription
SHOW PROCEDURES YIELD argumentDescription, returnDescription

Introduced an isDeprecated field to the argument and return description maps for SHOW FUNCTIONS and SHOW PROCEDURES.

The field is true if the argument/return value is deprecated and false otherwise.

Functionality Updated

SHOW CONSTRAINTS

Introduced propertyType column, which is returned by default. It returns a STRING representation of the property type for property type constraints, and null for other constraints.

New features

Feature Details

Functionality New

MATCH ((x:A)-[:R]->(z:B WHERE z.h > x.h)){1,5}

Introduction of quantified path patterns - a new method in graph pattern matching for matching paths of a variable length. More information can be found here.

Functionality New

New operator: Repeat(Trail)

The Repeat(Trail) operator is used to solve quantified path patterns. More information can be found here.

Functionality New

IS [NOT] :: <TYPE>

Added type predicate expressions. The available types are:

  • BOOLEAN

  • STRING

  • INTEGER

  • FLOAT

  • DATE

  • LOCAL TIME

  • ZONED TIME

  • LOCAL DATETIME

  • ZONED DATETIME

  • DURATION

  • POINT

Functionality New

CREATE CONSTRAINT name FOR (n:Label) REQUIRE n.prop IS :: <PROPERTY TYPE>

CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS :: <PROPERTY TYPE>

Added node and relationship property type constraints. The available property types are:

  • BOOLEAN

  • STRING

  • INTEGER

  • FLOAT

  • DATE

  • LOCAL TIME

  • ZONED TIME

  • LOCAL DATETIME

  • ZONED DATETIME

  • DURATION

  • POINT

Functionality New

SHOW NODE PROPERTY TYPE CONSTRAINTS

SHOW REL[ATIONSHIP] PROPERTY TYPE CONSTRAINTS

SHOW PROPERTY TYPE CONSTRAINTS

Added filtering for the new property constraints to SHOW CONSTRAINTS. Includes filtering for the node part, relationship part, or both parts.

Functionality New

SHOW SUPPORTED PRIVILEGE[S]

List supported privileges on the current server.

Neo4j 5.8

Updated features

Feature Details

Functionality Updated

SHOW INDEXES

Introduced lastRead, readCount, and trackedSince columns. Both lastRead and readCount are returned by default.

The lastRead column returns the last time the index was used for reading. The readCount column returns the number of read queries that have been issued to this index. The trackedSince column returns the time when usage statistics tracking started for this index.

New features

Feature Details

Functionality New

New operator: AssertSameRelationship

The AssertSameRelationship operator is used to ensure that no relationship property uniqueness constraints are violated in the slotted and interpreted runtime. More information can be found here.

Neo4j 5.7

Deprecated features

Feature Details

Functionality Deprecated

CYPHER connectComponentsPlanner=greedy MATCH (a), (b) RETURN *
CYPHER connectComponentsPlanner=idp MATCH (a), (b) RETURN *

The Cypher query option connectComponentsPlanner is deprecated and will be removed without a replacement. The product’s default behavior of using a cost-based IDP search algorithm when combining sub-plans will be kept.

Updated features

Feature Details

Functionality Updated

ALTER DATABASE ... [WAIT [n [SEC[OND[S]]]]|NOWAIT]

New sub-clause WAIT for ALTER DATABASE. This enables adding a waiting clause to specify a time limit in which the command must be completed and returned.

Functionality New

CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS UNIQUE

CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS RELATIONSHIP KEY

Added relationship key and property uniqueness constraints.

Functionality New

SHOW NODE UNIQUE[NESS] CONSTRAINTS

SHOW REL[ATIONSHIP] UNIQUE[NESS] CONSTRAINTS

SHOW UNIQUE[NESS] CONSTRAINTS

SHOW REL[ATIONSHIP] KEY CONSTRAINTS

SHOW KEY CONSTRAINTS

Added filtering for the new constraint types to SHOW CONSTRAINTS. Includes filtering for the node part, relationship part, or both parts of each type (NODE KEY filtering already exists previously).

The existing UNIQUENESS filter will now return both node and relationship property uniqueness constraints.

New features

Feature Details

Functionality New

CALL {
  <inner>
} IN TRANSACTIONS [ OF <num> ROWS ]
  [ ON ERROR CONTINUE / BREAK / FAIL ]
  [ REPORT STATUS AS <v> ]

New fine-grained control mechanism to control how an inner transaction impacts subsequent inner and/or outer transactions.

  • ON ERROR CONTINUE - will ignore errors and continue with the execution of subsequent inner transactions when one of them fails.

  • ON ERROR BREAK - will ignore an error and stop the execution of subsequent inner transactions.

  • ON ERROR FAIL - will fail in case of an error.

  • REPORT STATUS AS <v> - reports the execution status of the inner transaction (a map value including the fields started committed, transactionId, and errorMessage). This flag is disallowed for ON ERROR FAIL.

Neo4j 5.6

New features

Feature Details

Functionality New

server.tag

New functionality to change tags at runtime via ALTER SERVER. More information can be found in the Operations Manual → ALTER SERVER options.

Functionality New

COLLECT {
    ...
}

New expression which returns the results of a subquery collected in a list.

Functionality New

SHOW SETTING[S] [setting-name[,...]]
[YIELD { * | field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
[WHERE expression]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]

List configuration settings on the current server.

The setting-name is either a comma-separated list of one or more quoted STRING values or a single expression resolving to a STRING or a LIST<STRING>`.

Functionality New
New privilege:

SHOW SETTING[S] name-globbing[,...]

New privilege that controls a user’s access to desired configuration settings.

Neo4j 5.5

Deprecated features

Feature Details

Functionality Deprecated

RETURN 'val' as one, 'val' as two
UNION
RETURN 'val' as two, 'val' as one
RETURN 'val' as one, 'val' as two
UNION ALL
RETURN 'val' as two, 'val' as one

Using differently ordered return items in a UNION [ALL] clause is deprecated. Replaced by:

RETURN 'val' as one, 'val' as two
UNION
RETURN 'val' as one, 'val' as two
RETURN 'val' as one, 'val' as two
UNION ALL
RETURN 'val' as one, 'val' as two

New features

Feature Details

Functionality New

New operator: IntersectionNodeByLabelsScan

The IntersectionNodeByLabelsScan operator fetches all nodes that have all of the provided labels from the node label index. More information can be found here.

Neo4j 5.3

Updated features

Feature Details

Functionality Updated

SHOW DATABASES

Changes to the visibility of databases hosted on offline servers.

For such databases:

  • The address column will return NULL.

  • The currentStatus column will return unknown.

  • The statusMessage will return Server is unavailable.

Functionality Updated

EXISTS {
    ...
}

An EXISTS subquery now supports any non-writing query. For example, it now supports UNION and CALL clauses.

Functionality Updated

COUNT {
    ...
}

A COUNT subquery now supports any non-writing query. For example, it now supports UNION and CALL clauses.

Functionality Updated

SHOW UNIQUE[NESS] CONSTRAINTS

The property uniqueness constraint type filter now allow both UNIQUE and UNIQUENESS keywords.

New features

Feature Details

Functionality New

New operator: NodeByElementIdSeek

The NodeByElementIdSeek operator reads one or more nodes by ID from the node store, specified via the function elementId(). More information can be found here.

Neo4j 5.2

Updated features

Feature Details

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

Functionality New

DRYRUN REALLOCATE|DEALLOCATE DATABASES FROM <serverId>

To preview of the result of either REALLOCATE or DEALLOCATE without executing, prepend the command with DRYRUN.

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

Neo4j 5.0

Removed features

Feature Details

Functionality 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

Functionality Removed

SHOW INDEXES BRIEF
SHOW CONSTRAINTS BRIEF

Replaced by:

SHOW INDEXES
SHOW CONSTRAINTS

Functionality 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

Functionality Removed

CREATE INDEX ON :Label(prop)

Replaced by:

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

Functionality Removed

CREATE CONSTRAINT ON ... ASSERT ...

Replaced by:

CREATE CONSTRAINT FOR ... REQUIRE ...

Functionality Removed

CREATE BTREE INDEX ...

Functionality Removed

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

B-tree indexes are removed.

B-tree indexes used for STRING predicates 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

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

Functionality Removed
For privilege commands:

ON DEFAULT DATABASE

Replaced by:

ON HOME DATABASE

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

Functionality Removed

exists(prop)

Replaced by:

prop IS NOT NULL

Functionality Removed

NOT exists(prop)

Replaced by:

prop IS NULL

Functionality Removed

0...

Replaced by 0o....

Functionality Removed

0X...

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

Functionality Removed

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

Remaining support for repeated relationship variables is removed.

Functionality 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 <, <=, >, or >= on spatial points is removed. Instead, use:

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

Functionality Removed

USING PERIODIC COMMIT ...

Replaced by:

CALL {
  ...
} IN TRANSACTIONS

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

Functionality Removed

CALL { RETURN 1 }

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

CALL { RETURN 1 AS one }

Functionality 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

Functionality 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)

Functionality 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

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

Functionality Deprecated

()-[:A|:B]->()

Replaced by:

()-[:A|B]->()

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 LIST<STRING> 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 STRING values. It could also be an expression resolving to a STRING or a LIST<STRING> (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 [OR REPLACE] ALIAS compositeDatabase.aliasName ...
ALTER ALIAS compositeDatabase.aliasName
DROP ALIAS compositeDatabase.aliasName

The alias commands can now handle aliases in composite databases.

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

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.

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

Functionality New

1_000_000, 0x_FF_FF, 0o_88_88

Cypher now supports number literals with underscores between digits.

Functionality New

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 New

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 New

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

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

Functionality New

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 New

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 New

ENABLE SERVER ...

New Cypher command for enabling servers.

Functionality New

ALTER SERVER ... SET OPTIONS ...

New Cypher command for setting options for a server.

Functionality New

RENAME SERVER ... TO ...

New Cypher command for changing the name of a server.

Functionality New

REALLOCATE DATABASES

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

Functionality New

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

New Cypher command for moving all databases from servers.

Functionality New

DROP SERVER ...

New Cypher command for dropping servers.

Functionality New

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.

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

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

Functionality New

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

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

Neo4j 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 property 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[, ...] "}"]

Property uniqueness 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

Property uniqueness 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 property 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 STRING values, 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 STRING values, 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 Neo4j 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 Neo4j 4.4.8.

Functionality New

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

New Cypher command for altering an alias. Remote aliases are only supported from Neo4j 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 Neo4j 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 Neo4j 4.4.8.

Functionality New
New privilege:

CREATE ALIAS

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

Functionality New
New privilege:

ALTER ALIAS

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

Functionality New
New privilege:

DROP ALIAS

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

Functionality New
New privilege:

SHOW ALIAS

New privilege that allows a user to show aliases. Only supported since Neo4j 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.

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

Neo4j 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 property 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 CONSTRAINTS

New Cypher command for administering privilege for listing constraints.

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

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

Neo4j 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()

Only works for strings, lists and pattern comprehensions, and no longer works for paths. For versions above 5.0, use a COUNT expression instead:

RETURN COUNT { (a)-[]->(b) }

For versions below 5.0, use a pattern comprehension instead:

RETURN size([ (a)-[]->(b) | a ])

See size() and Count Subqueries 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.

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

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

Neo4j 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

Neo4j 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

Neo4j 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

Neo4j 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