Reputation: 363
I'm using neo4j 1.9.4.
Please consider the following two queries :
start z=node(*) where z._type! = 'aaa' return count(z);
start z=node(*) match z-[r?]-() where z._type! = 'aaa' return count(z), count(r);
Shouldn't the result of "count(z)" be the same for both of the two queries?
But I got a result of 2 much larger than the result of 1.
Is this a neo4j bug or is there something wrong with the queries?
Upvotes: 0
Views: 36
Reputation: 5918
no, because when there are nodes with several relationships, z-[r?]-()
will return several results and thus when returning count(z)
you will have duplicate values.
try to return count(DISTINCT z)
Upvotes: 2