neo4jrestclient,在创建节点后添加属性

2024-06-07 08:52:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图创建新节点,但当我在下一行添加额外属性时,它失败了。 例如:

gdb = GraphDatabase("http://localhost:7474/db/data/")
index = gdb.nodes.indexes.create('blogger')
for i in b:
  uid = gdb.nodes.create(user_id=x,gender=i[0],profile_views=i[1],industry=i[2],occupation=i[3],email=i[4],locality=i[5],country=i[6],region=i[7])
# till here it adds all the properties as mentioned
# following 2 lines of code fails
uid.setProperty('hosts',<value>)
uid.relationships.create("follows",<value>)

还有一个问题:如何将一个节点的属性之间的关系添加到另一个节点的属性中

例如:在上面的关系中,我想在主机之间创建对每个节点都是唯一的关系


Tags: localhosthttpdbuiddataindex属性节点

热门问题