cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Get ID for each node

rosdiana
Node Clone

Hi,

I want to get ID for each node. I am using movie data from neo4j database.

In Neo4j desktop, i get the output i want.

But when i using the same cypher query in Python, i dont get the same output as in No4j.

Below is my code in Python.

result = tx.run("MATCH (a:Person{name:$name})"
                         "-[:ACTED_IN]->(listMovie) "
                         "RETURN a,listMovie as listMovies", name=name).data()

Then this is the output when i apply using Python. There is no ID (identity) for each node.

Please help me, what mistake i did. Thank you!

1 ACCEPTED SOLUTION

Hello

You are not doing something wrong, should have a look at the function id() to get the Neo4j ID and the function properties() to get the properties of a node

Regards,
Cobra

View solution in original post

2 REPLIES 2

Hello

You are not doing something wrong, should have a look at the function id() to get the Neo4j ID and the function properties() to get the properties of a node

Regards,
Cobra

Thanks so much! Got it.