使用python rest客户端查询节点的neo4j

使用python rest客户端查询节点的neo4j,python,nosql,neo4j,Python,Nosql,Neo4j,我在索引中有具有以下属性的节点: {'user_id': u'00050714572570434939', 'hosts': [u'http://shyjive.blogspot.com/'], 'follows': ['null']} 现在我有了索引,我正在尝试通过简单的查询来索引节点,如下所示: index = gdb.nodes.indexes.create('blogger2') uid = gdb.nodes.create() uid["hosts"] = ['http://shyj

我在索引中有具有以下属性的节点:

{'user_id': u'00050714572570434939', 'hosts': [u'http://shyjive.blogspot.com/'], 'follows': ['null']}
现在我有了索引,我正在尝试通过简单的查询来索引节点,如下所示:

index = gdb.nodes.indexes.create('blogger2')
uid = gdb.nodes.create()
uid["hosts"] = ['http://shyjive.blogspot.com/']
uid["user_id"] = "00050714572570434939"
uid["follows"] = ['null']
print index["user_id"]["00050714572570434939"][:]
返回[],这里有什么问题


正如neo4j组上的开发人员所建议的那样,我在python中使用list的原因是我希望将多属性值存储到节点,因此我在这里使用list而不是数组,您首先需要为节点编制索引。如果未使用,则的代码为:

index["user_id"]["00050714572570434939"] = uid
现在你有:

>>> index["user_id"]["00050714572570434939"][:]
[<Neo4j Node: http://localhost:7474/db/data/node/38>]
>>索引[“用户id”][“00050714572570434939”][:]
[]

首先需要为节点编制索引。如果未使用,则的代码为:

index["user_id"]["00050714572570434939"] = uid
现在你有:

>>> index["user_id"]["00050714572570434939"][:]
[<Neo4j Node: http://localhost:7474/db/data/node/38>]
>>索引[“用户id”][“00050714572570434939”][:]
[]

谢谢您的时间,但当我尝试为列表编制索引时,因为我想为节点的属性添加多个值,例如:uid=gdb.nodes.create()index[“user\u id”][x]=uid index[“hosts”][source]=uid index[“followers”][dest]=uid在源和dest都是列表的上方,因此它会给我错误:tx=tx或值[1]索引器错误:列表索引超出范围不幸的是,目前还不支持列表作为索引键。但是它来了!感谢您的时间,但当我尝试为列表编制索引时,因为我想为节点的属性添加多个值,例如:uid=gdb.nodes.create()index[“user_id”][x]=uid index[“hosts”][source]=uid index[“followers”][dest]=uid在源和dest是列表之上,因此它会给我错误:tx=tx或值[1]索引器错误:列表索引超出范围不幸的是,目前还不支持列表作为索引键。但是它来了!