|

楼主 |
发表于 2023-11-15 01:21:27
|
显示全部楼层
from py2neo import Graph, Node, Relationship, NodeMatcher
from py2neo.matching import RelationshipMatcher
# 连接数据库
graph = Graph("http://localhost:7474", auth=('neo4j','a1234567'),name = 'neo4j')
person_node = Node("Person1", name="Alice1", age=25)
# 添加属性
person_node["gender"] = "female"
# 保存节点到数据库
graph.create(person_node) |
|