+4 votes
in Databases by (60.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 (71.8k points)
selected by
Best answer

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;

Related questions