The Neo4j Graph Platform – The #1 Platform for Connected Data Menu
The Neo4j Graph Platform – The #1 Platform for Connected Data Close

Neo4j AuraDB

Experience the lightning-fast speed and scalability of Neo4j's fully managed cloud database service for your application.
No credit card required
Prebuilt dataset
Interactive guide

Features

Everything you need to supercharge your next project
1-Click Database Setup

Get your graph database setup in the cloud with 1-Click setup

Scale On-Demand

Scale your database on-demand with no downtime

Driver Integrations

Use Neo4j with your favorite programming language and frameworks

Developer Tools

Jumpstart your next project with visualization and data importing tools, starter kits, and more

Automated Upgrades and Backups

Let us take care of database maintenance so you stay focused on what you do best

Enterprise-Class Security

Get granular security with advanced controls to protect sensitive data and meet compliance requirements.

Test Drive Neo4j

Don't take our word for it. Test drive Neo4j for yourself on this live Neo4j instance.

Seamlessly Integrate with Your Project

No matter your technology stack, we've got you covered with our official and community drivers.
// npm install --save neo4j-driver
// node example.js
const neo4j = require("neo4j-driver");
const driver = neo4j.driver("bolt://<HOST>:<BOLTPORT>", neo4j.auth.basic("<USERNAME>", "<PASSWORD>"), {
	/* encrypted: 'ENCRYPTION_OFF' */
});

const query = `
  MATCH (actor:Person {name: $actorName})-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(p:Person) 
  RETURN p.name as coActorName
  `;

const params = { actorName: "Tom Hanks" };

const session = driver.session({ database: "neo4j" });

session
	.run(query, params)
	.then((result) => {
		result.records.forEach((record) => {
			console.log(record.get("coActorName"));
		});
		session.close();
		driver.close();
	})
	.catch((error) => {
		console.error(error);
	});
# pip3 install neo4j-driver
# python3 example.py

from neo4j import GraphDatabase, basic_auth

driver = GraphDatabase.driver(
  "bolt://<HOST>:<BOLTPORT>", 
  auth=basic_auth("<USERNAME>", "<PASSWORD>"))

cypher_query = '''
MATCH (actor:Person {name: $actorName})-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(p:Person) 
RETURN p.name as coActorName
'''

with driver.session(database="neo4j") as session:
  results = session.read_transaction(
    lambda tx: tx.run(cypher_query,
      actorName="Tom Hanks").data())

  for record in results:
    print(record['coActorName'])

driver.close()
// go mod init main
// go run example.go
package main
import (
	"fmt"
	"github.com/neo4j/neo4j-go-driver/neo4j" //Go 1.8
)
func main() {
	s, err := runQuery("bolt://<HOST>:<BOLTPORT>", "<USERNAME>", "<PASSWORD>")
	if err != nil {
		panic(err)
	}
	fmt.Println(s)
}
func runQuery(uri, username, password string) ([]string, error) {
	configForNeo4j4 := func(conf *neo4j.Config) { conf.Encrypted = false }
	driver, err := neo4j.NewDriver(uri, neo4j.BasicAuth(username, password, ""), configForNeo4j4)
	if err != nil {
		return nil, err
	}
	defer driver.Close()
	sessionConfig := neo4j.SessionConfig{AccessMode: neo4j.AccessModeRead, DatabaseName: "neo4j"}
	session, err := driver.NewSession(sessionConfig)
	if err != nil {
		return nil, err
	}
	defer session.Close()
	results, err := session.ReadTransaction(func(transaction neo4j.Transaction) (interface{}, error) {
		result, err := transaction.Run(
			`
			MATCH (actor:Person {name: $actorName})-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(p:Person) 
			RETURN p.name as coActorName
			`, map[string]interface{}{
				"actorName": "Tom Hanks",
			})
		if err != nil {
			return nil, err
		}
		var arr []string
		for result.Next() {
			value, found := result.Record().Get("coActorName")
			if found {
			  arr = append(arr, value.(string))
			}
		}
		if err = result.Err(); err != nil {
			return nil, err
		}
		return arr, nil
	})
	if err != nil {
		return nil, err
	}
	return results.([]string), err
}
// Add your the driver dependency to your pom.xml build.gradle etc.
// Java Driver Dependency: http://search.maven.org/#artifactdetails|org.neo4j.driver|neo4j-java-driver|4.0.1|jar
// Reactive Streams http://search.maven.org/#artifactdetails|org.reactivestreams|reactive-streams|1.0.3|jar
// download jars into current directory
// java -cp "*" Example.java

import org.neo4j.driver.*;
import static org.neo4j.driver.Values.parameters;

public class Example {

  public static void main(String...args) {

    Driver driver = GraphDatabase.driver("bolt://<HOST>:<BOLTPORT>",
              AuthTokens.basic("<USERNAME>","<PASSWORD>"));

    try (Session session = driver.session(SessionConfig.forDatabase("neo4j"))) {

      String cypherQuery =
        "MATCH (actor:Person {name: $actorName})-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(p:Person)" +
        "RETURN p.name as coActorName"

      var result = session.readTransaction(
        tx -> tx.run(cypherQuery, 
                parameters("actorName","Tom Hanks"))
            .list());

      for (Record record : result) {
        System.out.println(record.get("coActorName").asString());
      }
    }
    driver.close();
  }
}
Output
{
  "coActorName" : [
    "Gary Sinise",
    "Kevin Bacon",
    "Bill Paxton",
    "Parker Posey",
    "Greg Kinnear",
    "Meg Ryan",
    "Steve Zahn",
    "Dave Chappelle",
    "Madonna",
    "Rosie O'Donnell",
    "Geena Davis",
    "Bill Paxton",
    "Lori Petty",
    "Nathan Lane",
    "Meg Ryan",
    "Liv Tyler",
    "Charlize Theron",
    "Ian McKellen",
    "Audrey Tautou",
    "Paul Bettany",
    "Jim Broadbent",
    "Halle Berry",
    "Hugo Weaving",
    "Helen Hunt",
    "Sam Rockwell",
    "Bonnie Hunt",
    "Patricia Clarkson",
    "James Cromwell",
    "Michael Clarke Duncan",
    "David Morse",
    "Gary Sinise",
    "Meg Ryan",
    "Victor Garber",
    "Bill Pullman",
    "Rita Wilson",
    "Rosie O'Donnell",
    "Julia Roberts",
    "Philip Seymour Hoffman",
  ]
}

Get Started for Free with AuraDB