Sanjay
Sanjay

Reputation: 505

Cypher query not returning the nodes it should return

I have two nodes that belong to one of the two labels:Class or Method, as is encircled in yellow in the two images here. The cypher queries to look for Method labelled nodes are working properly in all cases. However, quite strangely, the cypher queries to return Class labelled nodes give empty results when using properties to select certain nodes. enter image description here

In the image above, it can be seen that the query Match (n:Class{Cycles:"52888"}) return n that is encircled in red, gives nothing, although such a node exist as is encircled in green. It is to be noted that a query for the Class nodes without the use of property runs fine. The problem became even more confusing when similar query worked absolutely correctly for Method labelled nodes even with use of property to select certain nodes as is visible in the image below. enter image description here Can anyone explain why the Cypher queries are behaving differently with the Class labelled nodes and what is the solution to the problem.

Upvotes: 2

Views: 443

Answers (2)

Karthikeyan Velmurugan
Karthikeyan Velmurugan

Reputation: 631

If the property of Cycles is Long, use the Query

MATCH (n:Class) WHERE n.Cycles = 52888 RETURN n

If the property of Cycles is String, use the Query

MATCH (n:Class) WHERE n.Cycles = "52888" RETURN n

Upvotes: 0

Michael Hunger
Michael Hunger

Reputation: 41676

Perhaps there is a space before or after the number?

Try

MATCH (n:Class) WHERE trim(n.Cycles) = "52888" RETURN n

Upvotes: 1

Related Questions