class carrier(object):
def __init__(value):
value=value
def get_driver(self): # 获取neo4j的session
driver = GraphDatabase.driver('bolt://localhost:7687', auth=('test', '11'))#本地neo4j
return driver
def run_cypher(self,cypher): # 运行cypher
driver=self.get_driver()
with driver.session() as session:
with session.begin_transaction() as tx:
run=tx.run(cypher)
return run