I would like to find out all reachable nodes via one specific relationship starting from a node.
I have the below graphs.
(User) --[LOGGED_IN]--> (Ip)
(User) --[FRIEND]--> (User)
I would like to find all reachable User nodes thru LOGGED_IN relationship. eg.
user1 logged_in ip1
user2 logged_in ip1
user2 logged_in ip2
user3 logged_in ip2
user3 logged_in ip3
user4 logged_in ip3
user5 logged_in ip4
user1 friend user5
If I start from user1 I want to find user1, user2, user3, user4. I would like to ignore the FRIEND relationship.
I know if I only have [:LOGGED_IN] relationship I can do the below cypher. But I also have FRIEND relationship and this will also give me the users linked by [:FRIEND]
MATCH (u:User)-[*]->(connected:User)
WHERE u.user_id = <user1_id>
RETURN connected