In the Querying with Cypher course, in "Limiting the number of intermediate results" (Controlling Results Returned - Querying with Cypher in Neo4j 4.x), the query specifies LIMIT 6 in the WITH clause. However, in the results posted and what I got experimenting in the Neo4j browser myself, 7 nodes are returned: "Emil Eifrem", "Lawrence Fishburne", "Hugo Weaving", "Carrie-Anne Moss", "Keanu Reeves", "The Matrix", and "The Matrix Reloaded".
Can anyone help me understand what is at play here to make things work this way? Thanks!
Almost. LIMIT applies to the number of rows, not necessarily the number of nodes.
You have WITH m, p LIMIT 6, so you will get 6 rows, each row containing an m and a p. It may help to visualize it by returning at that point (a RETURN instead of a WITH on that line, and omit the rest).
After the result rows are limited, the collection happens, where, per m.title, you collect the names of the associated p nodes.