bash $ pip install py2neo python from py2neo import Graph graph = Graph("bolt://localhost:7687", username="neo4j", password="password") python node = graph.nodes.create(name="Alice", age=30) python node1 = graph.nodes.create(name="Alice") node2 = graph.nodes.create(name="Bob") relationship = node1.create_relationship_to(node2, "FRIEND_OF") relationship["since"] = 2022 relationship.push() python results = graph.run("MATCH (n)-[r]->(m) RETURN n, r, m") for record in results: print(record["n"]["name"], record["r"].type, record["m"]["name"])


上一篇:
下一篇:
切换中文