php - neo4j/Everyman - how to pass in a string parameter? -
The parameter is trying to pass in a string value as the following:
$ names = array ('test0', 'test1', 'test2'); $ Q0 = "match (n: label0 {id: '{param0}'}) return n"; $$ = $ Q1- & gt; getResultSet () ($ Name as $ name) {$ q1 = new Everyman \ Neo4j \ Cypher \ Query ($ connection, $ q0, Array ( 'param0' = & gt; $ name);) run this code Gives me the 3 var_dump output, which results in no result. If I get the actual ultimate value (instead of getting it from the array), I get the expected result set. Anyway, if I enter the query using NEO 4J-Shell, then I expect that value (th) I get . So what am I doing wrong? I'm sure I'm using it wrongly, but I do not know how.
I can put the variable directly and the query also works (though this parameter anywhere in the query). It is doing this only through a parameter that seems problematic.
Edit:
- neo4j v2.1.4
$ q0 =" match (n: label0 {id: {param0}}) return n "; What happens if you do this? That single quote?
You can rewrite your query:
and enter the entire string array as the absolute
$ names = array ( 'Test0', 'test1', 'test2'); $ Q0 = "match (N: label 0) WHERE n.id IN {param0} return n"; Make $ Q1 = new Everyman \ Neo4j \ Cypher \ Query ($ connection, $ q0, array ( 'param0' = & gt; $ name); Make sure Index At: label0 (name)
Comments
Post a Comment