Upgrade from older versions

This page contains the list of new features and breaking changes of the driver from version 5.28 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 might also need updating. The Drivers Migration Assistent doesn’t cover Cypher changes.
See Cypher → Deprecations, additions, and compatibility.

New features

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.

Breaking changes and deprecations

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

Version Message Status

6.0

Minimum supported Go version is 1.24.

Changed

6.0

Session.WriteTransaction() and Session.ReadTransaction() have been removed in favor of Session.ExecuteWrite() and Session.ExecuteRead(). The logic is the same, but the argument type changed from Transaction to ManagedTransaction, and explicit transaction handling methods (.Commit(), .Rollback(), .Close()) are not available on managed transactions anymore.

Removed

6.0

neo4j.Transaction has been removed in favor of neo4j.ExplicitTransaction.

Removed

6.0

neo4j.TransactionWork has been removed in favor of neo4j.ManagedTransactionWork.

Removed

6.0

Config.RootCAs has been removed in favor of Config.TlsConfig.

Removed

6.0

neo4j.Config has been removed in favor of config.Config.

Removed

6.0

neo4j.ServerAddress has been removed in favor of config.ServerAddress.

Removed

6.0

neo4j.NewServerAddress() has been removed in favor of config.NewServerAddress().

Removed

6.0

neo4j.ServerAddressResolver has been removed in favor of config.ServerAddressResolver.

Removed

6.0

Logging

Removed

6.0

Notifications-related objects have been moved from the global namespace neo4j into neo4j/notifications.

As a result, neo4j.(NotificationSeverity|Warning|Information|UnknownSeverity|NotificationCategory|Hint|Unrecognized|Unsupported|Performance|Deprecation|Generic|Security|Topology|UnknownCategory) have been removed in favor of notifications.(NotificationSeverity|Warning|Information|UnknownSeverity|NotificationCategory|Hint|Unrecognized|Unsupported|Performance|Deprecation|Generic|Security|Topology|UnknownCategory).

Removed

5.0

Node.Id and Relationship.Id are deprecated in favor of Node.ElementId and Relationship.ElementId. Old identifiers were Int64, whereas new ElementIds are String.

Deprecated

6.0

*WithContext functions and types are deprecated in favor of the non-suffixed names, which are context-aware by default. In particular,

Deprecated

6.0

Type StatementType is deprecated in favor of QueryType.

As a result, ResultSummary.StatementType() is deprecated in favor of ResultSummary.QueryType().

Deprecated