2
我是在python2.7中使用Neo4j的新手。現在我已經嘗試了一個關於Neo4j的簡單測試,但我無法找到數據庫中的特定節點。該節點已存在,但返回結果爲'無'。 這裏是我的代碼:Neo4j:爲什麼我在python中找不到find_one的特定節點?
from py2neo import Graph,Node,Relationship
test_graph = Graph(
"http://localhost:7474",
username="neo4j",
password="******"
)
test_node_1 = Node(label = "Person",name = "test_node_1")
test_node_2 = Node(label = "Person",name = "test_node_2")
test_graph.create(test_node_1)
test_graph.create(test_node_2)
node_1_call_node_2 = Relationship(test_node_1,'CALL',test_node_2)
node_2_call_node_1 = Relationship(test_node_2,'CALL',test_node_1)
test_graph.create(node_1_call_node_2)
test_graph.create(node_2_call_node_1)
find_code_1 = test_graph.find_one(
label="Person",
property_key="name",
property_value="test_node_1"
)
print (find_code_1)