Hi

This is my first post and a continuation of a discussion with the
@neo4j account on twitter.

Having read this web page:

http://docs.neo4j.org/chunked/milestone/rest-api-transactional.html

I constructed the body of a REST POST to
http://<myserver>/db/data/transaction/<tx> like this:

{
    "statements":[{
        "statement":"MATCH (u:User{username:{username}}), (r:Role
name:{rolename}})\nCREATE(u)-[:HAS_ROLE]-\u003e(r)",
          "parameters":{
            "props":{
                "username":"user1","rolename":"ROLE_REST_USER"
            }
        }
    }]
}

I received no error code back from Neo4j by way of the POST. When my
update wasn't applied to the database I had to look at the response
message to see the problem:

{
    "commit":"http://localhost:7474/db/data/transaction/32/commit";,
    "results":[],
    "transaction":{"expires":"Tue,24 Dec 2013 11:16:17+0000"},
    "errors":[{
        "code":"Neo.ClientError.Statement.ParameterMissing",
        "message":"Expected a parameter named username"
        }]
}

With a little bit of guess work I figured that the 'props' element
under 'parameters' wasn't required, rejigged the JSON and it worked.

However, I'm left thinking that:

1. The documentation at the above link may need correcting (or perhaps
I'm just being dumb and missing something).
2. The POST should have returned an error code.

What do you guys think?


-- 
Thanks
Paul

Paul Grenyer
e: [email protected]
b: paulgrenyer.blogspot.com
t: pjgrenyer

Have you thought what Naked Element could do for you? http://nakedelement.co.uk/

It's time to get technical: http://norfolkdevelopers.com

Norfolk Developers Conference is coming: http://nordevcon.com/

Enjoyed working with me? Something I could work on? Give me honest,
anonymous feedback: https://www.get3sixty.com/:wehop

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to