我正在尝试使用从定向数据库中提取记录pyorient
,这是我的查询:
query = "SELECT value FROM (SELECT expand(Elements) FROM dataset) WHERE type = 'XXX'"
records = client.command(query)
一切正常。当我尝试打印记录时,这是我得到的:
record = records[0]
print type(record)
<class 'pyorient.otypes.OrientRecord'>
print record
{{'value': 'Name'},'version':0,'rid':'#-2:0'}
并且由于我只需要从中提取 ' Name
' record
,因此我尝试了:
print record[0]
并得到
TypeError: 'OrientRecord' object does not support indexing
这是结果repr
:
print(repr(record))
<pyorient.otypes.OrientRecord object at 0x7fdcdb531ad0>