簡體   English   中英

(Py2neo) - 如何使用 py2neo 指令從 neo4j 數據庫返回關系 ID

[英](Py2neo) - How to return relationship id from neo4j database by using py2neo instruction

是否有任何 py2neo 指令可以返回存儲在 neo4j 數據庫中的關系邊的 id? 謝謝你。

這是它在 cypher 中的樣子:

match (a:SINGLE_NODE)-[r:IS_CONNECTED]->(b:SINGLE_NODE) 
where a.name='KEY' and b.name = 'ROOM' return id(r)

這個解決方案對我來說效果很好:

for rel in db.match((a,None), r_type=None):
    print(rel.end_node["name"], rel.start_node["name"], rel.identity)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM