[PYTHON] neo4j sandbox part 5

Overview

I tried sandbox with neo4j. I hit it from python.

Installation

pip install neo4j-driver

Sample code

from neo4j import GraphDatabase, basic_auth

driver = GraphDatabase.driver("bolt://54.*.*.222:32939", auth=basic_auth("neo4j", "****"))
session = driver.session()
cypher_query = '''
MATCH (n)
RETURN n
'''
results = session.run(cypher_query, parameters = {})
for record in results:
	print(record)


result


<Record n=<Node id=0 labels=frozenset({'Point'}) properties={'name': 'p1'}>>
<Record n=<Node id=1 labels=frozenset({'Point'}) properties={'name': 'p2'}>>
<Record n=<Node id=2 labels=frozenset({'Point'}) properties={'name': 'p3'}>>
<Record n=<Node id=3 labels=frozenset({'Point'}) properties={'name': 'p4'}>>
<Record n=<Node id=4 labels=frozenset({'Point'}) properties={'name': 'p5'}>>


that's all.

Recommended Posts

neo4j sandbox part 12
neo4j sandbox part 5
neo4j sandbox part 13
neo4j sandbox part 15
neo4j sandbox part 16
neo4j sandbox part 11
sandbox with neo4j part 10
datetime part 1
numpy part 1
argparse part 1
numpy part 2