如何从<class'py2neo.database.record'=“”>获取字典或列表

时间:2016-05-18 09:35:47

标签: neo4j py2neo

使用py2neo连接到neo4j DB: 如何将“class'py2neo.database.Record'”转换为python中的字典或列表?

2 个答案:

答案 0 :(得分:2)

您可以直接将Record转换为列表:

result = graph.cypher.execute('MATCH (n) RETURN n')

a_record = result[0] # -> this is a Record object

list_of_things_in_record = list(a_record)

print(list_of_things_in_record)

答案 1 :(得分:0)

似乎任何 unixtimestamp, event1/value (dtype boolean), event2/value (dtype float64) 1595235332848, False, NaN 1595235333254, True , NaN 1595235333785, NaN , 123.12323 中的 data()-Method 都可以将其转换为 neo4j.data.Record

dict