Functions
This section contains information on all functions in the Cypher® query language.
Related information may be found in Operators.
|
To list the available functions, run the following Cypher query:
SHOW FUNCTIONS
These functions return either true or false for the given arguments.
Function | Signature | Description |
---|---|---|
|
Returns true if the predicate holds for all elements in the given |
|
|
Returns true if the predicate holds for at least one element in the given |
|
|
Returns |
|
|
Checks whether a |
|
|
Checks whether a |
|
|
Checks whether a |
|
|
Returns true if the predicate holds for no element in the given |
|
|
Returns true if the predicate holds for exactly one of the elements in the given |
These functions return a single value.
Function | Signature | Description |
---|---|---|
|
Returns the number of Unicode characters in a |
|
|
Returns the number of Unicode characters in a |
|
|
Returns the first non-null value in a list of expressions. |
|
|
Returns the end |
|
|
Returns the first element in a |
|
|
Deprecated Returns the id of a |
|
|
Deprecated Returns the id of a |
|
|
Returns the last element in a |
|
|
Returns the length of a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Generates a random UUID. |
|
|
Returns the number of items in a |
|
|
Returns the number of Unicode characters in a |
|
|
Returns the start |
|
|
Converts a |
|
|
Converts a |
|
|
Converts an |
|
|
Converts a value to a |
|
|
Converts an |
|
|
Converts a |
|
|
Converts a value to a |
|
|
Converts a |
|
|
Converts a |
|
|
Converts a |
|
|
Converts a value to an |
|
|
Returns a |
|
|
Returns a |
These functions take multiple values as arguments, and calculate and return an aggregated value from them.
Function | Signature | Description |
---|---|---|
|
Returns the average of a set of |
|
|
Returns the average of a set of |
|
|
Returns the average of a set of |
|
|
Returns a list containing the values returned by an expression. |
|
|
Returns the number of values or rows. |
|
|
Returns the maximum value in a set of values. |
|
|
Returns the minimum value in a set of values. |
|
|
Returns the percentile of a value over a group using linear interpolation. |
|
|
Returns the nearest |
|
|
Returns the nearest |
|
|
Returns the standard deviation for the given value over a group for a sample of a population. |
|
|
Returns the standard deviation for the given value over a group for an entire population. |
|
|
Returns the sum of a set of |
|
|
Returns the sum of a set of |
|
|
Returns the sum of a set of |
These functions return lists of other values. Further details and examples of lists may be found in Lists.
Function | Signature | Description |
---|---|---|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Runs an expression against individual elements of a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns all but the first element in a |
|
|
Converts a |
|
|
Converts a |
|
|
Converts a |
|
|
Converts a |
These functions all operate on numerical expressions only, and will return an error if used on any other values.
Function | Signature | Description |
---|---|---|
|
Returns the absolute value of a |
|
|
Returns the absolute value of an |
|
|
Returns the smallest |
|
|
Returns the largest |
|
|
Returns |
|
|
Returns |
|
|
Returns a random |
|
|
Returns the value of a number rounded to the nearest |
|
|
Returns the value of a number rounded to the specified precision using rounding mode HALF_UP. |
|
|
Returns the value of a number rounded to the specified precision with the specified rounding mode. |
|
|
Returns the signum of a |
|
|
Returns the signum of an |
These functions all operate on numerical expressions only, and will return an error if used on any other values.
Function | Signature | Description |
---|---|---|
|
Returns the base of the natural logarithm, e. |
|
|
Returns en, where e is the base of the natural logarithm, and n is the value of the argument expression. |
|
|
Returns the natural logarithm of a |
|
|
Returns the common logarithm (base 10) of a |
|
|
Returns the square root of a |
These functions all operate on numerical expressions only, and will return an error if used on any other values.
All trigonometric functions operate on radians, unless otherwise specified.
Function | Signature | Description |
---|---|---|
|
Returns the arccosine of a |
|
|
Returns the arcsine of a |
|
|
Returns the arctangent of a |
|
|
Returns the arctangent2 of a set of coordinates in radians. |
|
|
Returns the cosine of a |
|
|
Returns the cotangent of a |
|
|
Converts radians to degrees. |
|
|
Returns half the versine of a number. |
|
|
Returns the mathematical constant pi. |
|
|
Converts degrees to radians. |
|
|
Returns the sine of a |
|
|
Returns the tangent of a |
These functions are used to manipulate strings or to create a string representation of another value.
Function | Signature | Description |
---|---|---|
|
Returns a |
|
|
Returns the given |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns the given |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a substring of the given |
|
|
Returns a substring of a given |
|
|
Returns the given |
|
|
Converts an |
|
|
Converts an |
|
|
Returns the given |
|
|
Returns the given |
Values of the temporal types — DATE
, ZONED TIME
, LOCAL TIME
, ZONED DATETIME
, and LOCAL DATETIME
— can be created manipulated using the following functions:
Function | Signature | Description |
---|---|---|
|
Creates a |
|
|
Returns the current |
|
|
Returns the current |
|
|
Returns the current |
|
|
Truncates the given temporal value to a |
|
|
Creates a |
|
|
Creates a |
|
|
Creates a |
|
|
Returns the current |
|
|
Returns the current |
|
|
Returns the current |
|
|
Truncates the given temporal value to a |
|
|
Creates a |
|
|
Returns the current |
|
|
Returns the current |
|
|
Returns the current |
|
|
Truncates the given temporal value to a |
|
|
Creates a |
|
|
Returns the current |
|
|
Returns the current |
|
|
Returns the current |
|
|
Truncates the given temporal value to a |
|
|
Creates a |
|
|
Returns the current |
|
|
Returns the current |
|
|
Returns the current |
|
|
Truncates the given temporal value to a |
DURATION
values of the temporal types can be created manipulated using the following functions:
Function | Signature | Description |
---|---|---|
|
Constructs a |
|
|
Computes the |
|
|
Computes the |
|
|
Computes the |
|
|
Computes the |
These functions are used to specify 2D or 3D points in a geographic or cartesian Coordinate Reference System and to calculate the geodesic distance between two points.
Function | Signature | Description |
---|---|---|
|
Returns a |
|
|
Returns a 2D point object, given two coordinate values in the Cartesian coordinate system. |
|
|
Returns a 3D point object, given three coordinate values in the Cartesian coordinate system. |
|
|
Returns a 2D point object, given two coordinate values in the WGS 84 geographic coordinate system. |
|
|
Returns a 3D point object, given three coordinate values in the WGS 84 geographic coordinate system. |
|
|
Returns |
LOAD CSV functions can be used to get information about the file that is processed by LOAD CSV
.
Function | Signature | Description |
---|---|---|
|
Returns the absolute path of the file that LOAD CSV is using. |
|
|
Returns the line number that LOAD CSV is currently using. |
Graph functions provide information about the constituent graphs in composite databases.
Function | Signature | Description |
---|---|---|
|
Resolves the constituent graph to which a given element id belongs. Introduced in Neo4j 5.13 |
|
|
Resolves a constituent graph by name. |
|
|
Returns a list containing the names of all graphs in the current composite database. |
|
|
Returns a map containing the properties associated with the given graph. |
Database functions Introduced in 5.12
Database functions provide information about databases.
Function | Signature | Description |
---|---|---|
|
Resolves the database name from the given element id. Introduced in 5.12 |
User-defined functions are written in Java, deployed into the database and are called in the same way as any other Cypher function. There are two main types of functions that can be developed and used:
Type | Description | Usage | Developing |
---|---|---|---|
Scalar |
For each row the function takes parameters and returns a result. |
||
Aggregating |
Consumes many rows and produces an aggregated result. |
Was this page helpful?