Reputation: 1095
This is the query where I am trying to get some data but in this particular query its giving me error. The query is something that on the level of nodes I am checking that the particular property is being used in any other node(here n4), as if property is being used we can't delete that particular property.
Match(n1:TESTDATA{nodeName:'HierarchyName'})-[:hasSubClass]->(n2)-[:hasPropertyGroup]->(n3)
-[:containsProperty]->(n4) with n2 ,n4
match (n2)-[:hasInstance]->(n5)
where n2.elementType='class'
and not(n4.status = 'Deleted')
and n4.nodeName <>'Property' and count(n5)=0
return n4.nodeName
Invalid use of aggregating function count(...) in this context (line 6, column 38 (offset: 277)) "and n4.nodeName='Property' and count(n5)=0"
Upvotes: 0
Views: 333
Reputation: 15490
Invalid use of aggregating function count(...)
yes, you cant use count
like this, either use count
with WITH
and another solution change your query
Match(n1:TESTDATA{nodeName:'HierarchyName'})-[:hasSubClass]->(n2)-[:hasPropertyGroup]->(n3)-[:containsProperty]->(n4)
WHERE n2.elementType='class'
AND NOT (n2)-[:hasInstance]->()
AND NOT(n4.status = 'Deleted')
AND n4.nodeName <>'Property'
WITH n4
return n4.nodeName
Upvotes: 1