python - 如何使用python获取orient db中顶点的边缘对象数据

标签 python orientdb

import pyorient

# create connection 
client = pyorient.OrientDB("localhost", 2424) 

# open databse 
client.db_open( "Test", "admin", "admin" )

requiredObj = client.command(' select from chat where app_cat=appCategory and module=module and type=type and prob_cat=problemCategory  ')

print requiredObj[0]

输出:

#Output
{'@Chat':{'prob_cat': 'PERFORMANCE', 'type': 'NON FUNCTIONAL', 'module': 'app', 'out_': <pyorient.otypes.OrientBinaryObject object at 0x10d1d6c10>, 'app_cat': 'RETAIL', 'issue': 'Non Capture of Data'},'version':7,'rid':'#22:0'}

这里我想重新绑定(bind) out_': <pyorient.otypes.OrientBinaryObject object>使用Python。当我尝试使用此代码来解除对象绑定(bind)时,会出现此错误

print requiredObj[0].out_[0]

TypeError: 'OrientBinaryObject' object does not support indexing

最佳答案

你可以使用

requiredObj = client.command(' select expand(out()[0]) from chat where app_cat=appCategory and module=module and type=type and prob_cat=problemCategory  ')

print(requiredObj[0])

希望对你有帮助

关于python - 如何使用python获取orient db中顶点的边缘对象数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39483354/

相关文章:

python - 以列表形式检索 numpy 记录数组的字段格式

python - 从文本文件存储列表

python - 在python pandas数据框中修复City,State,Zip数据

java - 如何检查OrientDB服务器是否正在创建/重建不稳定性?

java - orientdb使用Index.get()查询复合索引

python - 对已使用无服务器推出的 lambda 函数设置重试策略

VsCode 中的 python 模块管理

grails - 东方数据库:无法创建索引

orientdb - 如何更改orientdb中的输入类型

sql - OrientDB SQL 查询模拟多对多连接