I am using Neo4J Spatial cypher queries to find users in a 25KM radius, and among them find those who have the same hometown as I do. I used the following query:
START u=node(5),node=node:geom('withinDistance:[17.3,78.3,25.0]') MATCH (u)-[:hometown]->()<-[:hometown]-(o) RETURN o;
This query doesn't work the way I intended. It identifies all user nodes in the given radius and executes the same MATCH query, which is specific to user with node ID 5, for each of those nodes.
Splitting this problem into two parts, this is what I would like to combine. First part, identify all users in a 25 KM radius:
START node=node:geom('withinDistance:[17.3,78.3,25.0]') RETURN node;
Second part, identify all users who have the same hometown as I do:
START u=node(5) MATCH (u)-[:hometown]->()<-[:hometown]-(o) RETURN o;
How do I combine these two queries into a single query?