You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered REST::Neo4p is unable to parse the result of certain Cypher queries that use expressions calling Neo4j functions like collect() in the RETURN clause. Minimized example:
# set up graph for testingmy$q1 = REST::Neo4p::Query->new(<<END);
CREATE (a:Test)-[:TEST{test:true}]->(:Test)RETURN id(a)END$q1->execute();
my$id = $q1->fetch->[0];
# test collecting properties that are undefinedmy$q2 = REST::Neo4p::Query->new(<<END);
MATCH (p:Test)-[r]-(o) WHERE id(p) = {id}RETURN collect(r.void)END$q2->execute(id=>$id);
print Dumper $q2->fetch->[0]; # expected: []# dies: Can't use an undefined value as an ARRAY reference at REST/Neo4p/Query.pm line 428.# test collecting properties that have boolean valuesmy$q3 = REST::Neo4p::Query->new(<<END);
MATCH (p:Test)-[r]-(o) WHERE id(p) = {id}RETURN collect(r.test)END$q3->execute(id=>$id);
print Dumper $q3->fetch->[0]; # expected: [true]# dies: Not a HASH reference at REST/Neo4p/Query.pm line 358.
This issue is reproducible for REST::Neo4p 0.3020 with Neo4j versions 2.3.3, 3.0.0 and 3.3.5.
I worked around this issue by simplifying my queries, so I don’t need a fix at this time. But I still wanted to document it.
Furthermore I clearly remember having similar problems with the substring() function. Which is quite mystifying since producing a simple string is of course all it does, and I fail to see why e. g. substring('1999-12-31', 0, 4) would fail where '1999' succeeds. However, I now seem to be unable to reproduce this issue, so I suppose it’s not just possible, but in fact probable I simply made a mistake of some sort there.
Cheers,
Arne
The text was updated successfully, but these errors were encountered:
Running the example code above with the default agent reveals the following:
collect(r.void) no longer dies, but still returns undef (it's supposed to return an empty array ref [])
collect(r.test) still dies with the same message Not a HASH reference
But given that this issue is indeed not reproducible with the Neo4j::Driver agent, an easy solution might be to eventually make Neo4j::Driver the default agent.
Hi Mark,
I discovered REST::Neo4p is unable to parse the result of certain Cypher queries that use expressions calling Neo4j functions like collect() in the
RETURN
clause. Minimized example:This issue is reproducible for REST::Neo4p 0.3020 with Neo4j versions 2.3.3, 3.0.0 and 3.3.5.
I worked around this issue by simplifying my queries, so I don’t need a fix at this time. But I still wanted to document it.
Furthermore I clearly remember having similar problems with the substring() function. Which is quite mystifying since producing a simple string is of course all it does, and I fail to see why e. g.
substring('1999-12-31', 0, 4)
would fail where'1999'
succeeds. However, I now seem to be unable to reproduce this issue, so I suppose it’s not just possible, but in fact probable I simply made a mistake of some sort there.Cheers,
Arne
The text was updated successfully, but these errors were encountered: