I have a question. i am trying to resolve one cypher query. i have two nodes and associated two relationships. like,
sometimes its ok. I used the query,
(A)-[:Friend]-(B) with A count (B) return B as newfriend
.
If i use
(A)-[:Friend]->(B) with A count (B) return B as newfriend
OR
(A)<-[:Friend]-(B) with A count (B) return B as newfriend
sometimes it returns nothing. Is there any possibility where i can count this relationship as one because if a friend with B or B friend with A its the same thing.
thanks in advance.
I think you should have only one relationship for friendship, because one implies the other one. For Neo4j doesn't matter direction of relationship during traversal.
Then you can use cypher query without direction