Hi,
I need to create and use a database via the http endpoint. creating works but it still uses the default database (neo4j). When I try to use ":USE NAME" via http it complains that a ":" is not valid. But I need to create many different databases and use them... any idea how to solve this? Maybe I have the wrong url?
My url is:
"http://localhost:11006/db/data/transaction/commit"
That is the Error Message:
{"results"=>, "errors"=>[{"code"=>"Neo.ClientError.Statement.SyntaxError", "message"=>"Invalid input ':': expected (line 1, column 1 (offset: 0))\r\n\":USE Nemo13\"\r\n ^"}]}
That is the part of my script:
#creates Database in neo4j, if not exists --> works
caseName = currentCase.getName
payload = { "statements": [{ "statement": "CREATE DATABASE #{caseName}" }]}
returnValue = Client.post(url, headers, payload, use_ssl)
#uses that database --> error
string = ":USE #{caseName}"
puts string # Nemo13
payload = { "statements": [{ "statement": "#{string}"}]}
returnValue = Client.post(url, headers, payload, use_ssl)
puts returnValue # {"results"=>, "errors"=>[{"code"=>"Neo.ClientError.Statement.SyntaxError", "message"=>"Invalid input ':': expected (line 1, column 1 (offset: 0))\r\n\":USE Nemo13\"\r\n ^"}]}