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 errors

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.

Support for pandas 3

As of version 6.2, the driver is compatible with pandas 3.x.

The driver might indirectly behave differently when used with pandas 3. For example, calling Result.to_df on a Result containing a string-only column produces a pandas.DataFrame with dtype object for this column. When using pandas 3, the dtype will be StringDtype instead.

Breaking changes and deprecations

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

Version Message Status

6.0

Environment

  • Dropped support for Python 3.7, 3.8, 3.9.

  • Package-alias neo4j-driver stopped receiving updates starting with 6.0. Install neo4j instead.

  • setup.py has been removed. Use a recent enough packaging/build tool supporting pyproject.toml.

Removed

6.0

Session — Methods .read_transaction() and .write_transaction() have been removed in favor of .execute_read() and .execute_write(). Through the new methods, the first argument of transaction functions is a ManagedTransaction object. It behaves like a regular Transaction object, except it does not offer the .commit(), .rollback(), .close(), and .closed() methods.

Removed

6.0

Driver and session objects are not implicitly closed through __del__() (destructor) anymore. This behaviour was non-deterministic as there is no guarantee that the destructor would ever be called. A ResourceWarning is emitted instead.
Call driver.close() explicitly or create the driver via a with statement.

Removed

6.0

Driver — The config option trust is not available anymore. The options trusted_certificates and ssl_context are available.

Removed