Shalom Elkin
Shalom Elkin

Reputation: 11

The cypher regex operator in neo4j is giving unexpected behavior

I populated an empty NEO4J store with a single node:

 create (P: Per {Name: "Shalom"});

queried for it

neo4j> match (n) return n;
| (:Per {Name: "Shalom"}) |

tried regex, got the strangest response:

neo4j> match (n : Per) where n.Name =- ".*lom" return n;
Type mismatch: expected Float or Integer but was String (line 2, column 33 (offset: 33))
"match (n : Per) where n.Name =- ".*lom" return n;"

Any idea as to what is wrong here?

Upvotes: 0

Views: 65

Answers (1)

logisima
logisima

Reputation: 7478

The regex operator is not =- (equal minus) but =~ (equal tild).

So your query is : match (n : Per) where n.Name =~ ".*lom" return n

Upvotes: 2

Related Questions