I\'ve got a property quantity
on our Product
-nodes and am looking to do a cypher query that gives me all nodes with quantity = 20
... prob
MATCH (p:Product) WHERE toInt(p.quantity) = 20;
You can do it the other way round.
MATCH (p:Product) WHERE p.quantity = str(20) RETURN p;
should also work with params.
MATCH (p:Product) WHERE p.quantity = str({quantity}) RETURN p;
or even with inline property matches
MATCH (p:Product {quantity : str({quantity})}) RETURN p;
I too have been faced with that problem earlier. As far as I found out, it was not possible to do that conversion directly in cypher. I used a small Java script (using the standard Java API) to change the data types of the stored values. This is a couple of months ago though, so it might have changed with the 2.0 version.