Hello everybody, I would like to create nested count structures and check if a certain condition(s) is (are) satisfied. To illustrated what I would like to achieve I have created a simple cypher-example as you see in the following query. However, this query is not working since after a CALL a WHERE cannot be placed. I also tried different constellations also inside the WHERE with EXISTS which is also not working.
MATCH (p:Regesta)
CALL { MATCH (p)-->(other) RETURN count(other) as myCount }
thanks for your reply, but that is not what I wanted. I wanted to be flexible in the way I do the nesting with count. Since CALL {}-subquery can not be placed inside of a CALL {}-subquery, I assumed it should work with EXISTS{}-SUBQUERY. However, in EXISTS{}-SUBQUERY, no WITH-Clause can be called to define what shall be counted. CALL-IN-A-CALL still does not work see it at:
That is just regarding Cypher 4.4. I also asked my question in the discord developer chat, and just a few weeks later, they created Cypher 5.X functionality for subquery with Count. See: https://neo4j.com/docs/cypher-cheat-sheet/5/
From now on Cypher has the Subcall-procedure for COUNT.
MATCH (p:Regesta)
WHERE COUNT { (p)--(d:other) } > 1
RETURN p.name AS name
In this example the path will be counted and inside of the COUNT{} x further COUNTS{} can be placed.