+4 votes
in Databases by (19.0k points)
I want to use the ORDER BY clause in the Cypher query. How to sort the query output by a property?

1 Answer

+3 votes
by (21.4k points)

You can use ORDER BY to sort the output by a node property. Its usage is the same as SQL.

Here is an example of sorting movies by their release date in descending order.

MATCH (n:Movie) 

RETURN n.title, n.released 

ORDER BY n.released DESC;


...