There is only one type of node which name "User" (in green) and one type of edge which name "sell_product_to" (in green) in my database, i.e., the following
There're five group (or user-chain) in above figure where the name that behind each node is the node's property (username).
Question : I want to query the node which the name is Lin in any Peter's downstream node and return the entire group (user-chain), i.e., the following result
I tried the following cypher:
Match(n:User)-[r:sell_product_to]->(p:User) where n.username ='Peter' AND p.username='Lin' RETURN n,r,p
The result is the following :
Obviously it fail since not only the Henry node do not return but also lack other two user-chains where Peter's next user is not Lin but in Peter's downstream.
So, how can I make it? or at least return the node and edge between Peter and Lin but the entire chain don't show, i.e., the following
Thanks.