-
Suppose we have this structure with Person vertices and properties for their favorite drinks:
Given that we have this data...
...it seems you can lists all occurring drinks and how many fans they each have respectively by doing:
This is fine but I would like to limit the result to only list drink which have (num_of_fans > 1 and num_of_fans < 3) so only pepsi would be listed. It is like I want to add a second WHERE clause after the return. How can I achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I believe I found a solution. In the open cypher documentation (https://s3.amazonaws.com/artifacts.opencypher.org/openCypher9.pdf) in the section about WITH there is an example called "Filter on aggregate function results": Adapting their example to my problem above we can do this:
|
Beta Was this translation helpful? Give feedback.
I believe I found a solution.
In the open cypher documentation (https://s3.amazonaws.com/artifacts.opencypher.org/openCypher9.pdf) in the section about WITH there is an example called "Filter on aggregate function results":
Adapting their example to my problem above we can do this: