neo4j/community — pull request #913 by wfreeman (2012-10-10 03:51:33+00:00)
Title: Adding the ability to do ORDER BY, SKIP, LIMIT after WITH, before another optional MATCH

See the relevant docgen tests:

```
@Test def sort_collect_results() {
testQuery(
title = "Sort results before using collect on them",
text = "You can sort your results before passing them to collect, thus sorting the resulting collection.",
queryText = """start n=node(*) with n order by n.name desc limit 3 return collect(n.name)""",
returns = """A list of the names of people in reverse order, limited to 3, in a collection.""",
assertions = (p) => assertEquals(List(List("Emil", "David", "Cesar")), p.columnAs[Seq[String]]("collect(n.name)").toList))
}

@Test def limit_branching() {
testQuery(
title = "Limit branching of your path search",
text = "You can match paths, limit to a certain number, and then match again using those paths as a base As well as any number of similar limited searches.",
queryText = """start n=node(3) match n--m with m order by m.name desc limit 1 match m--o return o.name""",
returns = """Starting at Anders, find all matching nodes, order by name descending and get the top result, then find all the nodes connected to that top result, and return their names.""",
assertions = (p) => assertEquals(List("Anders", "Bossman"), p.columnAs[String]("o.name").toList))
}
```