When a database query encounters one, it will return instead of returning all.
Match (x)-[*]-(y) return x.name.
What I want to limit 1 is not to display 1, it only returns the first match one instead of the match-all and showing the first.
I am a new guy in the neo4j. I need ur help! Thanks for ur attention!
I want to find out if there is a special relationship between nodes A and B.
But I don't want to iterate over all nodes, like Match(x)-[r]-(y) Return Exists(r).
Facing the problem, all I need is only to find out if there exists a relation.
@Cobra, that was an interesting article. I did not know about the count store and use of the apoc method - very helpful.
I am also confused with the requirements. If the goal is to count the number of relationships between two specific nodes, then the following should work. Make sure to replace the 'where' clause predicates to match your selection criteria.
match(a)
where a.name = 'A'
match(b)
where b.name = 'B'
match (a)-[]-(b)
return count(*)