From e2bfb45dea048bc5370403988ad73d6451981efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandbox=20=F0=9F=A4=96?= Date: Thu, 4 May 2023 09:39:01 +0000 Subject: [PATCH] Triggered by dispatch event. Origin: https://github.com/neo4j-graph-examples/template/commit/b4dc2957032d1030fe0fb06ebf95a8947f940c0c --- code/javascript/example.js | 2 +- code/python/example.py | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/code/javascript/example.js b/code/javascript/example.js index 829e817..a755e17 100644 --- a/code/javascript/example.js +++ b/code/javascript/example.js @@ -3,7 +3,7 @@ const neo4j = require('neo4j-driver'); 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 e8983e3..4182d25 100644 --- a/code/python/example.py +++ b/code/python/example.py @@ -1,22 +1,20 @@ -# pip3 install neo4j-driver +# pip3 install neo4j # python3 example.py from neo4j import GraphDatabase, basic_auth -driver = GraphDatabase.driver( - "neo4j://:", - auth=basic_auth("", "")) - cypher_query = ''' MATCH (a:Officer {name:$name})-[r:OFFICER_OF|INTERMEDIARY_OF|REGISTERED_ADDRESS*..10]-(b) RETURN b.name as name LIMIT 20 ''' -with driver.session(database="neo4j") as session: - results = session.read_transaction( - lambda tx: tx.run(cypher_query, - name="Ross, Jr. - Wilbur Louis").data()) - for record in results: - print(record['name']) - -driver.close() +with GraphDatabase.driver( + "neo4j://:", + auth=("", "") +) as driver: + result = driver.execute_query( + cypher_query, + name="Ross, Jr. - Wilbur Louis", + database_="neo4j") + for record in result.records: + print(record['name'])