Using Neo4j from JavaScript

This guide introduces the Neo4j JavaScript driver and links to the relevant resources.

You should be familiar with graph database concepts and the property graph model. You should have created an Neo4j AuraDB cloud instance, or installed Neo4j locally.

Neo4j for JavaScript developers

Neo4j provides libraries that allow you to connect to the database and develop applications which create, read, update, and delete information from the graph.

The Neo4j JavaScript driver connects to the database using the binary protocol Bolt. It aims to be minimal while being idiomatic to JavaScript, allowing you to subscribe to a stream of responses, errors, and completion events.

For detailed information on how to build applications with Neo4j and JavaScript, go to the Neo4j JavaScript Driver Manual. There you can find instructions and code examples for every workflow step.

Driver configuration

From Neo4j 4.0 and onwards, the default encryption setting is off by default and Neo4j will no longer generate self-signed certificates. This applies to default installations, installations through Neo4j Desktop and Docker images. You can verify the encryption level of your server by checking the dbms.connector.bolt.enabled key in neo4j.conf.

Table 1. Table Scheme Usage
Certificate Type Neo4j Cluster Neo4j Standalone Server Direct Connection to Cluster Member

Unencrypted

neo4j

neo4j

bolt

Encrypted with Full Certificate

neo4j+s

neo4j+s

bolt+s

Encrypted with Self-Signed Certificate

neo4j+ssc

neo4j+ssc

bolt+ssc

Neo4j AuraDB

neo4j+s

N/A

N/A

Review your SSL Framework settings when going into production.

Name

Version

Authors

neo4j-driver

5.18.0

The Neo4j Team

Package

Neo4j Online Community

Docs

API

Source

The example project

The Neo4j example project is a small, one page webapp for the movies database built into the Neo4j tutorial. The front-end page is the same for all drivers: movie search, movie details, and a graph visualization of actors and movies. Each backend implementation shows you how to connect to Neo4j from each of the different languages and drivers.

You can learn more about our small, consistent example project across many different language drivers here. You will find the implementations for all drivers as individual GitHub repositories, which you can clone and deploy directly.

Learn with GraphAcademy

badge

Building Neo4j Applications with Node.js

In this free course, we walk through the steps to integrate Neo4j into your Node.js projects. You will learn about the Neo4j JavaScript driver, how sessions and transactions work and how to query Neo4j from an existing application.