function extract(variable IN list | expression)
To return a single property, or the value of a function from a list of nodes or relationships, you can use extract().
It will go through a list, run an expression on every element, and return the results in a list with these values.
It works like the map method in functional languages such as Lisp and Scala.
Arguments:
MATCH p=(a)-->(b)-->(c) WHERE a.name='Alice' AND b.name='Bob' AND c.name='Daniel' RETURN extract(n IN nodes(p)| n.age) AS extracted