Upgrade from older versions

This page contains the list of new features and breaking changes of the driver from version 5.28 to to 6.x. For a full list of changes, see the Driver → Changelog.

The latest driver version of the 6.x series is compatible with Neo4j server both 4.4, 5.x, and 202[56].x, so you can upgrade the driver before you upgrade the server. At the same time, the driver version 5.28 is forward compatible with Neo4j server 202[56].x, so you could also upgrade the server before the driver; however, given that it’s easier to roll back an application upgrade than a server upgrade, it’s recommended to start with the driver.

When upgrading the Neo4j server to a newer version, the Cypher queries in your application may also need updating.
See Cypher → Deprecations, additions, and compatibility.

New features

Value mapping

With the Value Mapping feature, you can declare a Java Record containing the specification of the values your query is expected to return, and ask the driver to use that class to spawn new objects from a query result.

New type Vector

The type Vector allows for storing and retrieving Cypher VECTOR objects to/from the database. The VECTOR type is suitable for efficiently storing lists of homogeneous numbers, such as embeddings.

GQL status objects in exceptions

Exception objects also expose errors as GQL-status objects. The main difference between Neo4j error codes and GQL error codes is that the latter are more granular. For more information, see Error handling.

Unix sockets support

The new bolt+unix URI scheme allows connecting to a Neo4j server over Unix sockets.

For more information, see Connecting through Unix sockets.

Netty native transports support

Netty native transports add features specific to a particular platform, generate less garbage, and generally improve performance when compared to the NIO based transport.

Breaking changes and deprecations

Deprecated features are likely to be removed in the next major version.

Version Message Status

6.0

Session — Methods .readTransaction() and .writeTransaction() have been removed in favor of .executeRead() and .executeWrite(). The same holds for their async conterparts .executeReadAsync() and .executeWriteAsync(). The new methods behave similarly, but the argument types are different and the new methods do not support the .commit(), .rollback(), .close(), and .closed() methods.

Removed

6.0

Interface RxSession has been removed in favor of ReactiveSession (Flow) and ReactiveSession (reactivestreams).
For reactive examples, see Control results flow with reactive streams.

Removed

6.0

Session — Methods .asyncSession() and .reactiveSession() have been removed. Use Session(Class), with Class controlling the desired type of session.

Removed

6.0

Config.TrustStrategy — Method .certFile() has been removed in favor of .certFiles().

Removed

6.0

Notification — Method .severity() has been removed. Use .rawSeverityLevel() for the raw value and .severityLevel() for an enumerated value.

Removed

6.0

Bookmarks

  • Method Session.lastBookmark() has been removed in favor of .lastBookmarks().

  • Bookmark no longer supports being initialized with multiple values (as Set<String>); only a single String can be passed. Multiple values are supported via multiple instances of Bookmark.

Removed

6.0

The default driver logging implementation has been changed from Logging.none() to Logging.systemLogging().

Changed

5.0

Node, Relationship — Method .id() (long) is deprecated in favor of .elementId() (string).

Deprecated

5.0

Relationship — Methods .startNodeId() and .endNodeId() are deprecated in favor of .startNodeElementId() and .endNodeElementId(). Old identifiers were long, whereas new ElementIds are string.

Deprecated

6.0

Notifications as Neo4j status codes are deprecated in favor of GQL status objects.

As a result,

Deprecated

6.0

The driver’s logging abstraction is deprecated in favour of System.Logger. As a result,

Deprecated