Reputation: 33
I have a label Users
which has a property userid
. So I want to fetch all nodes which have string type userid
. Is it possible?
Like:
MATCH (n:Users) where n.userid IS string RETURN n
Upvotes: 2
Views: 3984
Reputation: 16355
There is no out-of-the-box feature to check data types in Neo4j, but you can implicitly check if a given value is a string trying to convert to string and comparing to the original value, like this:
match (n:Users)
where toString(n.userid) = n.userid
RETURN n
Also, you can install APOC Library and use the function apoc.meta.type
, this way:
match (n:Users)
where apoc.meta.type(n.userid) = "STRING"
return n
Upvotes: 7