Last active
June 7, 2022 16:03
-
-
Save jalakoo/f5774b14193219aaf1eb8fa9e520442c to your computer and use it in GitHub Desktop.
Neo4j Simple Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j import GraphDatabase, unit_of_work | |
uri = "" | |
username = "" | |
password = "" | |
driver = GraphDatabase.driver(uri, auth=(username, password)) | |
@unit_of_work(timeout=30) | |
def generic_function(tx, **kwargs): | |
result = tx.run("MATCH (n) RETURN n", **kwargs) | |
return list(result) | |
with driver.session() as session: | |
result = session.read_transaction(generic_function) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment