I need to search nodes having property "totalValue", now i need to find 10 nodes having value closest to 100. I need some help to write a query which can return me required results.
Compute the distance, order by distance, limit to 10 ...
MATCH (n:Node)
RETURN n.totalValue AS value, abs(100 - n.totalValue) AS distance
ORDER BY distance
LIMIT 10;
Hope this helps.
Regards, Tom