finn
unread,Jul 3, 2015, 6:24:54 AM7/3/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to orient-...@googlegroups.com
Hi,
I realized that the previous question that I have asked is not clear and concise enough, so I did some research and ask it again :D.
I am testing the GRAPH example from GitHub:mogui/pyorient. The example creates a database named ‘animals’, within which exists a record #11:0. I use orient-console and got the record:
orientdb {db=animals}> select from animal
----+-----+------+----+------+--------
# |@RID |@CLASS|name|specie|out_Eat
----+-----+------+----+------+--------
0 |#11:0|Animal|rat |rodent|[size=1]
----+-----+------+----+------+--------
And I can get the type of the ‘out_Eat’ field like this:
orientdb {db=animals}> select out_Eat.type() from animal
----+------+-------
# |@CLASS|out_Eat
----+------+-------
0 |null |LINKBAG
----+------+———
However I can NOT get the RIDs of ‘out_Eat’ using pyorient. The related code and output is like:
>>> record = client.query("select * from Animal")[0]
>>> record.oRecordData
{'out_Eat': <pyorient.types.OrientBinaryObject object at 0x1018750b8>, 'name': 'rat', 'specie': 'rodent’}
>>> record.oRecordData['out_Eat']
<pyorient.types.OrientBinaryObject object at 0x1018750b8>
>>> record.oRecordData['out_Eat'].__dict__
{'b64': 'AQAAAAEADQAAAAAAAAAA’}
>>> record.oRecordData['out_Eat'].getBin()
b'\x01\x00\x00\x00\x01\x00\r\x00\x00\x00\x00\x00\x00\x00\x00’
>>> record.oRecordData['out_Eat'].getRaw()
‘_AQAAAAEADQAAAAAAAAAA_'
How can I get RID info stored in the ‘out_Eat’ field? Please throw in a light, thanks.