neo4jcypher

How to get node's id with cypher request?


I'm using neo4j and making executing this query:

MATCH (n:Person) RETURN n.name LIMIT 5

I'm getting the names but i need the ids too. Please help!


Solution

  • Since ID isn't a property, it's returned using the ID function.

    MATCH (n:Person) RETURN ID(n) LIMIT 5