From 19b6fe9b94523a255fa3f080efbb232349295a33 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 20 Dec 2019 01:14:24 +0100 Subject: [PATCH] Trying to find users located close to user --- backend/src/schema/resolvers/searches.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/src/schema/resolvers/searches.js b/backend/src/schema/resolvers/searches.js index 351eb26c0..a1c9d5962 100644 --- a/backend/src/schema/resolvers/searches.js +++ b/backend/src/schema/resolvers/searches.js @@ -71,3 +71,16 @@ export default { }, }, } + +/* +MATCH (u1:User { name: 'Huey' })-[:IS_IN]->(l1:Location) +MATCH (u2:User)-[:IS_IN]->(l2:Location) +WHERE NOT(u2.name = 'Huey') +WITH point({longitude: l1.lng, latitude: l1.lat}) AS P1, +point({longitude: l2.lng, latitude: l2.lat}) AS P2, +l1.name AS Location1, l2.name AS Location2 +WITH distance(P1, P2) AS Distance, +Location1 AS Location1, Location2 AS Location2 +ORDER BY Distance +RETURN Location1, Location2, Distance +*/