I am using the cypher
</>match (n:NodeEntity)
where not (n)<--(:NodeEntity)
return n</>
But this is also returning nodes which have a parent relationship..
I think you specified an inbound relationship when you should be using an outbound relationship for a parent
where not (n)<--(:NodeEntity)
This is the right way to express this, but this will return tree leaves not parents. Try reversing the arrow direction
Assuming data as follows:
The following query worked:
match(n:NodeEntity)
where not exists ((:NodeEntity)-->(n))
return n
if your relationships are in the other direction, flip the direction in the where pattern predicate, as @david_allen suggests.