I successfully merged nodes using the following code:
session = cypher.Session('http://192.168.56.20:7474/db/data/')
txa = session.create_transaction()
txa.append("""
MERGE (frame:FRAME {timestamp:{props}.ts})
ON CREATE SET frame:FIRST_FRAME
RETURN frame
""", props)
txa.commit()
result, = txa.commit()
frame, = result[0]
the logfile looks like this:
INFO:py2neo.packages.httpstream.http:>>> POST http://192.168.56.20:7474/db/data/transaction/commit [910]
DEBUG:py2neo.packages.httpstream.http:>>> Host: 192.168.56.20:7474
DEBUG:py2neo.packages.httpstream.http:>>> Content-Type: application/json
DEBUG:py2neo.packages.httpstream.http:>>> X-Stream: true;format=pretty
DEBUG:py2neo.packages.httpstream.http:>>> User-Agent: py2neo/1.6.1 HTTPStream/1.1.0 Python/2.7.5-final-0 (darwin)
INFO:py2neo.packages.httpstream.http:<<< 200 OK [chunked]
DEBUG:py2neo.packages.httpstream.http:<<< transfer-encoding: chunked
DEBUG:py2neo.packages.httpstream.http:<<< access-control-allow-origin: *
DEBUG:py2neo.packages.httpstream.http:<<< server: Jetty(9.0.5.v20130815)
DEBUG:py2neo.packages.httpstream.http:<<< content-type: application/json
DEBUG:py2neo.packages.httpstream.http:<<< content-encoding: UTF-8
And the result variable returned is:
[Record(columns=(u'frame',), values=(Node('http://0.0.0.0:7474/db/data/node/24'),))]
Notice the wrong uri (0.0.0.0)
when I try to use the returned node instance a Connection Exception is thrown. ie:
frame.remove_labels('FIRST_FRAME')
py2neo.packages.httpstream.http.SocketError: Connection refused
By the logged trace I can see it tried to get the data from the wrong server:
INFO:py2neo.packages.httpstream.http:>>> GET http://0.0.0.0:7474/db/data/node/24/properties
What am I doing wrong?