diff --git a/code/javascript/example.js b/code/javascript/example.js index 1ae306f..9726e4e 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 d6507e0..fe54160 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( - "neo4j://:", - auth=basic_auth("", "")) - cypher_query = ''' MATCH (p:Person {healthstatus:$status})-[v:VISITS]->(pl:Place) WHERE p.confirmedtime < v.starttime RETURN distinct pl.name as place LIMIT 20 ''' -with driver.session(database="neo4j") as session: - results = session.read_transaction( - lambda tx: tx.run(cypher_query, - status="Sick").data()) - for record in results: - print(record['place']) - -driver.close() +with GraphDatabase.driver( + "neo4j://:", + auth=("", "") +) as driver: + result = driver.execute_query( + cypher_query, + status="Sick", + database_="neo4j") + for record in result.records: + print(record['place'])