Scalar functions return a single value.
To return or filter on the length of a collection, use the LENGTH()
function.
Syntax: LENGTH( collection )
Arguments:
Query.
MATCH p=a-->b-->c WHERE a.name='Alice' RETURN length(p)
The length of the path p
is returned by the query.
Returns a string representation of the relationship type.
Syntax: TYPE( relationship )
Arguments:
Query.
MATCH (n)-[r]->() WHERE n.name='Alice' RETURN type(r)
The relationship type of r
is returned by the query.
Returns the id of the relationship or node.
Syntax: ID( property-container )
Arguments:
Query.
MATCH a RETURN ID(a)
This returns the node id for three nodes.
Returns the first non-null
value in the list of expressions passed to it.
Syntax: COALESCE( expression [, expression]* )
Arguments:
Query.
MATCH a WHERE a.name='Alice' RETURN coalesce(a.hairColour?, a.eyes?)
HEAD
returns the first element in a collection.
Syntax: HEAD( expression )
Arguments:
Query.
MATCH a WHERE a.name='Eskil' RETURN a.array, head(a.array)
The first node in the path is returned.
LAST
returns the last element in a collection.
Syntax: LAST( expression )
Arguments:
Query.
MATCH a WHERE a.name='Eskil' RETURN a.array, last(a.array)
The last node in the path is returned.
TIMESTAMP
returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. It will return the same value during the whole one query, even if the query is a long running one.
Syntax: TIMESTAMP()
Arguments:
Query.
START n=node(1) RETURN timestamp()
The time in milliseconds.
Copyright © 2013 Neo Technology