0
votes

I followed http://docs.neo4j.org/refcard/2.0/ for search using regular expression, it looks like Cypher2 has a problem with the operator "=~" it works for cypher parser 1.9 but not with version 2

==> http://console.neo4j.org/

Query:
CYPHER 1.9  START n=node(*) 
WHERE n.name =~ 'T.*' 
RETURN n

result=OK

Doesn't work after switching to cypher parser 2:

Query:
START n=node(*) 
WHERE n.name =~ 'T.*' 
RETURN n
Error: java.lang.ClassCastException: org.neo4j.cypher.internal.compiler.v1_9.commands.Query cannot be cast to org.neo4j.cypher.internal.compiler.v2_0.commands.AbstractQuery

==> Neo4j 2.0.0-M06

START n=node(*)
WHERE n.name =~ 's.*' 
RETURN n  

Expected 2 to be a java.lang.String, but it was a java.lang.Integer
STATEMENT_EXECUTION_ERROR

Any hint?

1
Are you having that problem on your own Neo4j instance or just at console.neo4j.org? I've seen a possibly related issue at the online console, but as fair as I can tell it is a problem in that web application, not in Neo4j. Also, your second query works for me on a fresh console, but not if I run your first query and then your second. Again, I think it's in the web app, not in Neo4j.jjaderberg
The second error output is from my own Neo4j server instance locally installed. the same query works at console.neo4j.org ONLY with cupher 1.9 not with 2.AJN
Recent builds of Neo4j 2.0.0-RC1 this should work, and console works now as Peter saysjjaderberg

1 Answers

2
votes

The console is now updated and working with the regexp for Neo4j 2.0 again, see http://console.neo4j.org/r/dcizjv

START n=node(*) 
WHERE n.name =~ 'T.*' 
RETURN n