I am trying to pass parameters for a cypher query. I have stepped through the sequence to xhr.send() and am passing it this data:
{"query":"match (U:User {UserID: {UID}})-[:HAS_ROLES]->(R: Roles) return R.Roles as Roles, {IDX} as indx","params":"{UID : \"0012\" ,IDX : 0} "}
Wireshark shows the data being sent to Neo4j as this:
Object Member Key: "query" String value: Member Key: "params" Object
Every POST I send has an empty params object, so clearly the way I am passing this data is not correct. How do I populate the params object?
I am using the ANNE stack.
Michael D. Spence Mockingbird Data Systems, Inc.
function runAdhocQueryParams(query,myparams) {
var call = $http({
method: 'POST',
data: { query: query, params: myparams },
url: '/api/runAdhocQuery',
headers: { 'Content-Type': 'application/json' }
});
return $q.when(call);
}
query is
match (U:User {UserID: {UID}})-[:HAS_ROLES]->(R: Roles) return R.Roles as Roles, {IDX} as indx
myparams is (in JSON)
{
"UID": "0012",
"IDX": 0
}