Getting node type from Java Query

Hey everyone, i using a java driver to query a graph database in java and get their values. I am working on transforming the data structure of the result to suitable data structure to apply my own algorithms.

So i am applying a query now : "Match (n) - [r] -> (m) Return n,r,m"
Is there a way when i get the results and iterate through the result List to know what type n is in each record? In the database i have 50 different labels. I want to know what label each node is.Any help is appreciated.

Thank you for the help,

DId you look at the java driver api docs?

https://neo4j.com/docs/api/java-driver/current/org/neo4j/driver/types/Node.html#labels--

Yes, i struggled to find it at first. But u have managed to fix it.
Thanks

1 Like