Try this, play around with it and let me know the output.
MATCH (u:User {uid:"777"})
WITH u
MATCH u<-[:BY]-(c1:Hashtag)-[rel:TO]-(c2:Hashtag)--(u)
RETURN rel, c1, c2
Basically, the idea here is as follow:
- Match the User node first
- Use it to match all 'Hashtag' nodes
- Use it to match to all 'Hashtag' nodes connected to the previous 'Hashtag nodes
- Return the 'rel', which is all the relationships from 'Hashtag' nodes to 'Hashtag' nodes which are connected to the user 777