neo4j-cypher: all paths between any two users -


i have network, in user can connected in patterns below.

(u:user{guid:123})<-[r]-(mg)<-[r2]-(c) (u:user{guid:123})<-[r]-(mg)<-[r2]-(c)<-[r3]-(mg2)<-[r4]-(c2) (u:user{guid:123})<-[r]-(mg)<-[r2]-(c)-[r3]->(mg2)-[r4]->(c2)<-[r5]-(mg3)<-[r6]-(c3) (u:user{guid:123})<-[r]-(mg)<-[r2]-(c)-[r3]->(mg2)-[r4]->(c2)<-[r5]-(mg3)<-[r6]-(c3)<-[r7]-(mg4)<-[r8]-(c4) 

'u' user guid.

there multiple pattern of connection between 2 user.

i want list paths between 2 users given guids. please give hints achieve this.

the following query return paths length between 1 , 5. adapt if need longer path (but influence query performance). might want add direction in path.

match path=(:user{guid:123})-[*1..5]-(:user{guid:456}) return path 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -