I am trying to delete child nodes except one child node.
when I execute this Cypher:
MATCH (n{name:'Java'})-[r]-(c)
return c.name
I am getting possible node names, but I need only longest node name and I have to delete rest of nodes and its relationships.