function size(list|pattern-expression)

To return or filter on the size of a list, use the size() function.

This is the same size() method described before, but instead of passing in a list directly, you provide a pattern expression that can be used in a match query to provide a new set of results. The size of the result is calculated, not the length of the expression itself.

Arguments:
list: An expression that returns a list
OR
pattern expression: A pattern expression that returns a list

Example Query:
    RETURN size(['Alice', 'Bob']) AS col

    MATCH (a)
    WHERE a.name='Alice'
    RETURN size((a)-->()-->()) AS fof