I have tried the following with a TEST_DB that I created in Neo4j desktop:
uri = "neo4j://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "password"))
with driver.session(database="TEST_DB") as session:
cypher = '''
MATCH (n) -[r:CITES]-> (m)
RETURN n, r, m
'''
output = session.run(cypher).data()
print(output)
As well as:
uri = "neo4j://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "password"))
session = driver.session(database="TEST_DB")
cypher = '''
MATCH (n) -[r:CITES]-> (m)
RETURN n, r, m
'''
result = session.run(cypher).data()
print(result)
session.close()
driver.close()
Both return an error:
ClientError: {code: Neo.ClientError.Database.DatabaseNotFound} {message: Unable to get a routing table for database 'TEST_DB' because this database does not exist}