-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow DISTINCT, ORDER BY, LIMIT, and SKIP within pattern comprehensions #202
Comments
Related to CIR-2017-190 |
Supporting usage of DISTINCT would also be great, otherwise we have to rely on |
Would be solved by #217 |
This seems like a very useful feature. Does anyone know the status on this? |
@SpaghettiFactory see my previous comment. This is (to be) solved by list subqueries, which is a generalisation of pattern comprehension. |
CIR-2017-202
While it is possible to take a slice of the resulting list from pattern comprehension, this operation is not lazy (like LIMIT), so all results of the comprehension must be computed to form the full list, then the resulting slice is taken.
This is request for using LIMIT (or perhaps a separate keyword, if the overloaded usage is too confusing) within a pattern comprehension, which only limits the number of results within the resulting collection. It will not limit the number of rows of the query.
Here's an example of a query using this proposed feature request that gets 5 actors, and for each of those 5 actors gets 2 movies they've acted in:
MATCH (actor:Person)
WITH actor LIMIT 5
RETURN actor, [(actor)-[:ACTED_IN]->(m:Movie) | m LIMIT 2] as movies
This also requests ORDER BY and SKIP, in similar placement, before LIMIT and after the expression defining the elements for the collection.
The text was updated successfully, but these errors were encountered: