bea*_*rdc 10 python neo4j py2neo
有没有办法使用py2neo迭代neo4j数据库中的每个节点?
我的第一个想法是迭代GraphDatabaseService
,但这不起作用.如果没有办法用py2neo做,那么还有另一个python接口可以让我吗?
编辑:我现在正在接受@Nicholas的答案,但如果有人能给我一种返回发电机的方法,我会更新它.
Nig*_*all 12
我建议使用异步Cypher,例如:
from py2neo import neo4j, cypher
graph_db = neo4j.GraphDatabaseService()
def handle_row(row):
node = row[0]
# do something with `node` here
cypher.execute(graph_db, "START z=node(*) RETURN z", row_handler=handle_row)
Run Code Online (Sandbox Code Playgroud)
当然,您可能希望排除引用节点或以其他方式调整查询.
的NiGe
归档时间: |
|
查看次数: |
3476 次 |
最近记录: |