diff --git a/code/javascript/example.js b/code/javascript/example.js index dab852b..ba347ed 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 e00b09d..e85f1d2 100644 --- a/code/python/example.py +++ b/code/python/example.py @@ -1,12 +1,8 @@ -# 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 (u:User {state: $state} )-[:WATCHED]->(m)-[:HAS]->(g:Genre) @@ -14,11 +10,13 @@ ORDER BY freq DESC ''' -with driver.session(database="neo4j") as session: - results = session.read_transaction( - lambda tx: tx.run(cypher_query, - state="Texas").data()) - for record in results: - print(record['genre']) - -driver.close() +with GraphDatabase.driver( + "neo4j://:", + auth=("", "") +) as driver: + result = driver.execute_query( + cypher_query, + state="Texas", + database_="neo4j") + for record in result.records: + print(record['genre'])