Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-10-2021 12:41 PM
This is from the tutorial: :play https://guides.neo4j.com/got/01_eda.html. The "Game Of Thrones” dataset.
MATCH (c:Character)-->()
WITH c, count(*) AS num
RETURN min(num) AS min, max(num) AS max, avg(num) AS avg_characters, stdev(num) AS stdev
Result:
|min|max|avg_characters|stdev|
|---|---|---|---|
|1|148|6.578856152512995|14.160455871718893|
'-->': What does this do?
'num': Are arrays of what?
Solved! Go to Solution.
05-10-2021 12:54 PM
A bit more context, -->
is shorthand for -[]->
, so this is MATCHing on paths of a :Character node with a relationship (of any type) to any kind of node, then per character getting a count of rows. As a result per row we have each character and the number of relationships for that character (so num
isn't an array, it's just an integer count, and we have a separate count per row/character). Then we apply aggregations over that count.
05-10-2021 12:47 PM
Hello @lingvisa
It counts the relations by node c
. One tip is to use RETURN
to check what you get 😉
-->
represents the relation.
Regards,
Cobra
05-10-2021 12:54 PM
A bit more context, -->
is shorthand for -[]->
, so this is MATCHing on paths of a :Character node with a relationship (of any type) to any kind of node, then per character getting a count of rows. As a result per row we have each character and the number of relationships for that character (so num
isn't an array, it's just an integer count, and we have a separate count per row/character). Then we apply aggregations over that count.
All the sessions of the conference are now available online