0

For a set of nodes a from a query (like MATCH (a:Type) WHERE ... WITH a), I want to find the node(s) that maximize the property a.number. With max I can maximize the number itself, but how do I get the whole object a which maximizes a.number?

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142

1 Answers1

1

Do you mean you want to return the node with the largest a.number?

You can MATCH the nodes, ORDER BY number and RETURN only one node:

MATCH (a:Type)  
RETURN a ORDER BY a.number DESC LIMIT 1
Martin Preusse
  • 9,151
  • 12
  • 48
  • 80