Neo4j Go Driver is now Generally Available

The official Neo4j Go Driver 4.x is now out of beta!

Florent Biville
Neo4j Developer Blog
2 min readDec 14, 2020

--

Gopher artwork by Ashley McNamara (CC BY-NC-SA 4.0)

As you might have heard in my last joint stream with Eric Solender on GoGM, the 4.2.0 version of the Go Driver for Neo4j has been released this week and supports the following Neo4j versions:

This release means that the Go Driver is finally aligned with all the other official Neo4j drivers.

From now on, every stable release of the Go Driver will be coordinated with the other official driver releases, hurray!

Our examples have already been updated, such as the unmissable Movies repository for Go.

If you want to get started, follow the previous link or just copy and adapt these few snippets.

First, you need to initialize your project and add the 4.x driver dependency:

go mod init github.com/<org>/<name>
go get github.com/neo4j/neo4j-go-driver/v4

Once you’ve done that, you’re ready to write your first program and run your first queries:

Line 11 include the credentials of a ready-to-use Neo4j Sandbox instance. The Neo4j Sandbox is a very convenient way to get started with Neo4j in a few clicks. If you like managed services, we also got you covered for production with Neo4j Aura!

Lines 21 to 25 instantiate the (usually singleton) Driver so that we can open new sessions and run queries against our configured Neo4j instance.

Once the session is opened (and closed later via defer) on lines 26 and 27, we can finally run a query via a read-only transaction function from lines 28 to 49, in order to fetch all the actor names playing in the legendary “Matrix” movie.

And that is all that is needed to get started!

Happy Coding,

Florent

--

--