2015-04-23 55 views
-1

我正在玩Neo4j的Py2neo API,有人可以告訴我如何使用pull()方法從中提取數據。有人能給我一個例子。Neo4j的Py2neo Api

我做了以下內容:

Node1=Node("Person",Name="Kartieya"); 
Graph().create(Node1); 
Graph().pull(Node1); 

我recieving 200的狀態,即其工作,但如何我要去得到Node1.Name?

回答

1

pushpull只對現有節點上的更改有必要。立即執行create報表。

from py2neo import Graph, Node 
graph = Graph() 

# note the trailing ',' for tuple unpacking 
# 'create' can create more than one element at once 
node1, = graph.create(Node("Person",Name="Kartieya")) 

爲了讓您的節點Name財產做:

print node1.properties['Name'] 

如果你現在改變你必須使用推一個屬性:

node1["new_prop"] = "some_value" 
node1.push() 

pull只需要如果性能在服務器上更改node1,並且您想同步本地node1實例。