Back to The Neo4j Cypher Manual

See Also Neo4jGraph Database

Cypher Manual - Functions

1. Predicate functions

https://neo4j.com/docs/cypher-manual/3.5/functions/predicate/

Function

Description

all()

Tests whether the predicate holds for all elements in a list.

any()

Tests whether the predicate holds for at least one element in a list.

exists()

Returns true if a match for the pattern exists in the graph, or if the specified property exists in the node, relationship or map.

none()

Returns true if the predicate holds for no element in a list.

single()

Returns true if the predicate holds for exactly one of the elements in a list.

2. Scalar functions

Function

Description

coalesce()

Returns the first non-null value in a list of expressions.

endNode()

Returns the end node of a relationship.

head()

Returns the first element in a list.

id()

Returns the id of a relationship or node.

last()

Returns the last element in a list.

length()

Returns the length of a path.

properties()

Returns a map containing all the properties of a node or relationship.

randomUUID()

Returns a string value corresponding to a randomly-generated UUID.

size()

Returns the number of items in a list.

size() applied to pattern expression

Returns the number of sub-graphs matching the pattern expression.

size() applied to string

Returns the number of Unicode characters in a string.

startNode()

Returns the start node of a relationship.

timestamp()

Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

toBoolean()

Converts a string value to a boolean value.

toFloat()

Converts an integer or string value to a floating point number.

toInteger()

Converts a floating point or string value to an integer value.

type()

Returns the string representation of the relationship type.

3. Aggregating functions

https://neo4j.com/docs/cypher-manual/3.5/functions/aggregating/

Function

Description

avg() - Numeric values

Returns the average of a set of numeric values.

avg() - Durations

Returns the average of a set of Durations.

collect()

Returns a list containing the values returned by an expression.

count()

Returns the number of values or rows.

max()

Returns the maximum value in a set of values.

min()

Returns the minimum value in a set of values.

percentileCont()

Returns the percentile of a value over a group using linear interpolation.

percentileDisc()

Returns the nearest value to the given percentile over a group using a rounding method.

stDev()

Returns the standard deviation for the given value over a group for a sample of a population.

stDevP()

Returns the standard deviation for the given value over a group for an entire population.

sum() - Numeric values

Returns the sum of a set of numeric values.

sum() - Durations

Returns the sum of a set of Durations.

4. List functions

Function

Description

keys()

Returns a list containing the string representations for all the property names of a node, relationship, or map.

labels()

Returns a list containing the string representations for all the labels of a node.

nodes()

Returns a list containing all the nodes in a path.

range()

Returns a list comprising all integer values within a specified range.

reduce()

Runs an expression against individual elements of a list, storing the result of the expression in an accumulator.

relationships()

Returns a list containing all the relationships in a path.

reverse()

Returns a list in which the order of all elements in the original list have been reversed.

tail()

Returns all but the first element in a list.

5. Mathematical functions - numeric

Function

Description

6. Mathematical functions - logarithmic

Function

Description

7. Mathematical functions - trigonometric

Function

Description

8. String functions

Function

Description

9. Temporal functions - instant types

Function

Description

10. Temporal functions - duration

Function

Description

11. Spatial functions

Function

Description

12. User-defined functions

Function

Description

13. Reference

MainWiki: Cypher_Manual_Functions (last edited 2018-12-23 08:48:09 by twotwo)