Functions
This section contains a summary of all functions in Cypher®.
To list all functions, run the following query:
SHOW FUNCTIONS
For more information about this command, see SHOW FUNCTIONS.
Functions taking a |
Aggregating functions
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 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 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 |
Database functions
Database functions provide information about databases.
Function | Signature | Description |
---|---|---|
|
Resolves the database name from the given element id. |
GenAI functions
Function | Signature | Description |
---|---|---|
|
Encode a given resource as a vector using the named provider. |
Graph functions
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 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. |
List functions
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 |
|
|
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 |
LOAD CSV functions
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. |
Logarithmic functions
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 |
Numeric functions
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 an |
|
|
Returns the smallest |
|
|
Returns the largest |
|
|
Returns |
|
|
Returns a random |
|
|
Returns the value of a number rounded to the nearest |
|
|
Returns the signum of an |
Trigonometric functions
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 |
Predicate 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 the given |
|
|
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 |
Scalar functions
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 a node or relationship identifier, unique within a specific transaction and DBMS. |
|
|
Returns the end |
|
|
Returns the first element in a |
|
|
Deprecated Returns the id of a |
|
|
Returns the last element in a |
|
|
Returns the length of a |
|
|
Returns |
|
|
Returns a |
|
|
Generates a random UUID. |
|
|
Returns the number of items in a |
|
|
Returns the start |
|
|
Converts a |
|
|
Converts a value to a |
|
|
Converts a |
|
|
Converts a value to a |
|
|
Converts a |
|
|
Converts a value to an |
|
|
Returns a |
|
|
Returns a |
String functions
These functions are used to manipulate STRING
values or to create a STRING
representation of another value.
Function | Signature | Description |
---|---|---|
|
Returns the given |
|
|
Returns a |
|
|
Returns the given |
|
|
Returns the given |
|
|
Normalizes a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns the given |
|
|
Returns a |
|
|
Returns a substring of a given |
|
|
Returns the given |
|
|
Converts an |
|
|
Converts an |
|
|
Returns the given |
|
|
Returns the given |
|
|
Returns the given |
Spatial functions
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 2D or 3D point object, given two or respectively three coordinate values in the Cartesian coordinate system or WGS 84 geographic coordinate system. |
|
|
Returns a |
|
|
Returns |
Temporal duration functions
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 |
Temporal instant types functions
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 |
User-defined functions
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. |
Vector functions
Vector functions allow you to compute the similarity scores of vector pairs.
Function | Signature | Description |
---|---|---|
|
Returns a |
|
|
Returns a |