From 401f883129af464569fd5377da1bba3459275fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandbox=20=F0=9F=A4=96?= Date: Thu, 4 May 2023 09:39:52 +0000 Subject: [PATCH] Triggered by dispatch event. Origin: https://github.com/neo4j-graph-examples/template/commit/b4dc2957032d1030fe0fb06ebf95a8947f940c0c --- code/csharp/Example.cs | 2 +- code/go/example.go | 2 +- code/java/Example.java | 2 +- code/javascript/example.js | 4 ++-- code/python/example.py | 24 +++++++++++------------- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/code/csharp/Example.cs b/code/csharp/Example.cs index a8fc9cc..384b570 100644 --- a/code/csharp/Example.cs +++ b/code/csharp/Example.cs @@ -13,7 +13,7 @@ namespace dotnet { class Example { static async Task Main() { - var driver = GraphDatabase.Driver("bolt://:", + var driver = GraphDatabase.Driver("neo4j://:", AuthTokens.Basic("", "")); var cypherQuery = diff --git a/code/go/example.go b/code/go/example.go index ac5b541..dce840e 100644 --- a/code/go/example.go +++ b/code/go/example.go @@ -10,7 +10,7 @@ import ( ) func main() { - results, err := runQuery("bolt://:", "neo4j", "", "") + results, err := runQuery("neo4j://:", "neo4j", "", "") if err != nil { panic(err) } diff --git a/code/java/Example.java b/code/java/Example.java index 1cf84b2..d085868 100644 --- a/code/java/Example.java +++ b/code/java/Example.java @@ -11,7 +11,7 @@ public class Example { public static void main(String...args) { - Driver driver = GraphDatabase.driver("bolt://:", + Driver driver = GraphDatabase.driver("neo4j://:", AuthTokens.basic("","")); try (Session session = driver.session(SessionConfig.forDatabase("neo4j"))) { diff --git a/code/javascript/example.js b/code/javascript/example.js index bc0b81a..512cf40 100644 --- a/code/javascript/example.js +++ b/code/javascript/example.js @@ -1,9 +1,9 @@ // npm install --save neo4j-driver // node example.js const neo4j = require('neo4j-driver'); -const driver = neo4j.driver('bolt://:', +const driver = neo4j.driver('neo4j://:', neo4j.auth.basic('', ''), - {/* encrypted: 'ENCRYPTION_OFF' */}); + {}); const query = ` diff --git a/code/python/example.py b/code/python/example.py index 3e28a76..16f9681 100644 --- a/code/python/example.py +++ b/code/python/example.py @@ -1,23 +1,21 @@ -# pip3 install neo4j-driver +# pip3 install neo4j # python3 example.py from neo4j import GraphDatabase, basic_auth -driver = GraphDatabase.driver( - "bolt://:", - auth=basic_auth("", "")) - cypher_query = ''' MATCH (p1:PointOfInterest {type:$type}), (p2:PointOfInterest) WHERE p1<>p2 AND distance(p1.location,p2.location) < 200 RETURN p2.name as name ''' -with driver.session(database="neo4j") as session: - results = session.read_transaction( - lambda tx: tx.run(cypher_query, - type="clock").data()) - for record in results: - print(record['name']) - -driver.close() +with GraphDatabase.driver( + "neo4j://:", + auth=("", "") +) as driver: + result = driver.execute_query( + cypher_query, + type="clock", + database_="neo4j") + for record in result.records: + print(record['name'])