我創建了一個關係,現在我想獲得關係的價值。neo4j通過python獲得關係值
低於我的Python腳本:
from neo4j.v1 import GraphDatabase, basic_auth
from neo4j.v1 import Record as Record
result=session.run('''MATCH (:Person {mobile:111111111})-[r]-() RETURN r''')
listresult= list(result)
for x in list(result):
print x
返回值:
<Record r=<Relationship id=2 start=26 end=27 type=u'CONTRACT20161118' properties={u'grade': [400], u'month': [20161118]}>>
<Record r=<Relationship id=1 start=26 end=27 type=u'CONTRACT' properties={u'grade': [800], u'month': [20161117]}>>
我怎樣才能獲得的記錄類型返回的值?
你是對的!謝謝 !我改變這個結果= session.run('''MATCH(:Person {mobile:15309912652}) - [r] - ()RETURN PROPERTIES(r)''') # for result in: print x [ 'PROPERTIES(R)'] – zhaowei