Neo4J get node by ID

Niraj Chauhan picture Niraj Chauhan · Mar 13, 2014 · Viewed 62.9k times · Source

I am using neo4j for one of my project, there's a node which only has a single property as name, I want to get that node using ID, it already has a ID but when I use this code

MATCH (s:SKILLS{ID:65110}) return s

It returns nothing, heres my node

enter image description here

If the query is wrong then how do I query it using the number

Answer

Damon Horrell picture Damon Horrell · Mar 13, 2014
MATCH (s)
WHERE ID(s) = 65110
RETURN s

The ID function gets you the id of a node or relationship. This is different from any property called id or ID that you create.