Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-01-2022 10:37 PM
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!
06-02-2022 12:48 AM
06-02-2022 02:13 AM
Hello @Cobra 😀
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.
One is enough.
Thanks for ur attention!
Regards,
gmac0q
06-02-2022 02:20 AM
I see, in this case, I advise you to use the count store which allows you to have very fast requests.
Regards,
Cobra
06-03-2022 04:06 AM
@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(*)
06-03-2022 05:26 AM
Hello @glilienfield 🙂
It's not possible:
Limitation - Can’t use the count store with labels present on both start and end nodes
The count store does not keep metadata with respect to labels on both the start and end node.
Regards,
Cobra
All the sessions of the conference are now available online