-
-
Save gigenthomas/dbe627c41b2e66c851570d546dd8bf70 to your computer and use it in GitHub Desktop.
A Cypher examples to unwind and collect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COLLECT - Gathers data into a List | |
======================================== | |
match (a {name:"Daniel"}), (b {name:"Jerry"}) | |
with a,b | |
match s = shortestPath(a-[]-b) | |
unwind nodes(s) as n | |
with collect(n) as m | |
return head(m) | |
MATCH(u:User) | |
WITH u | |
ORDER BY u.name | |
WITH COLLECT({name:u.name,date:u.date}) AS userinfo | |
RETURN userinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match (a {name:"Daniel"}), (b {name:"Jerry"}) | |
with a,b | |
match s = shortestPath(a-[]-b) | |
unwind nodes(s) as n | |
return n.name as Names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment