-
-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Hello,
Yesterday during my test, I skipped some stuff that would require the implementation of some functions.
I did NOT keep a track of the missing ones, but we can still have a list there https://neo4j.com/docs/cypher-manual/current/functions/
IMHO, priority number 1 should be adding elementId()
I have no idea how to add subtasks on github, like gitlab, so i'll shove the whole list there.
We do NOT personally need those function, I'm just giving a hand at tracking what's missing
I'm taking the bet that any agent with enough documentation from the neo4j wiki could do it easily
Aggregating functions
These functions take multiple values as arguments, and calculate and return an aggregated value from them.
-
avg()--avg(input :: INTEGER | FLOAT | DURATION) :: INTEGER | FLOAT | DURATION-- Returns the average of a set ofINTEGER,FLOAT, orDURATIONvalues. -
collect()--collect(input :: ANY) :: LIST<ANY>-- Returns a list containing the values returned by an expression. -
count()--count(input :: ANY) :: INTEGER-- Returns the number of values or rows. -
max()--max(input :: ANY) :: ANY-- Returns the maximum value in a set of values. -
min()--min(input :: ANY) :: ANY-- Returns the minimum value in a set of values. -
percentileCont()--percentileCont(input :: FLOAT, percentile :: FLOAT) :: FLOAT-- Returns the percentile of a value over a group using linear interpolation. -
percentileDisc()--percentileDisc(input :: INTEGER | FLOAT, percentile :: FLOAT) :: FLOAT-- Returns the nearestINTEGERorFLOATvalue to the given percentile over a group using a rounding method. -
stDev()--stDev(input :: FLOAT) :: FLOAT-- Returns the standard deviation for the given value over a group for a sample of a population. -
stDevP()--stDevP(input :: FLOAT) :: FLOAT-- Returns the standard deviation for the given value over a group for an entire population. -
sum()--sum(input :: INTEGER | FLOAT | DURATION) :: INTEGER | FLOAT | DURATION-- Returns the sum of a set ofINTEGER,FLOAT, orDURATIONvalues.
Database functions
Database functions provide information about databases.
-
db.nameFromElementId()--db.nameFromElementId(elementId :: STRING) :: STRING-- Resolves the database name from the given element id.
Graph functions
Graph functions provide information about the constituent graphs in composite databases.
-
graph.byElementId()--USE graph.byElementId(elementId :: STRING)-- Resolves the constituent graph to which a given element id belongs. -
graph.byName()--USE graph.byName(name :: STRING)-- Resolves a constituent graph by name. -
graph.names()--graph.names() :: LIST<STRING>-- Returns a list containing the names of all graphs in the current composite database. -
graph.propertiesByName()--graph.propertiesByName(name :: STRING) :: MAP-- 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.
-
coll.distinct()--coll.distinct(list :: LIST<ANY>) :: LIST<ANY>-- Returns the given list with all duplicate values removed. -
coll.flatten()--coll.flatten(list :: LIST<ANY>, depth = 1 :: INTEGER) :: LIST<ANY>-- Returns a list flattened to the given depth. -
coll.indexOf()--coll.indexOf(list :: LIST<ANY>, value :: ANY) :: INTEGER-- Returns the index of the first match of value in the given list, if the value is no present, -1 is returned. -
coll.insert()--coll.insert(list :: LIST<ANY>, index :: INTEGER, value :: ANY) :: LIST<ANY>-- Returns a list with the given value inserted at the given index. -
coll.max()--coll.max(list :: LIST<ANY>) :: ANY-- Returns the largest value. -
coll.min()--coll.min(list :: LIST<ANY>) :: ANY-- Returns the smallest value. -
coll.remove()--coll.remove(list :: LIST<ANY>, index :: INTEGER) :: LIST<ANY>-- Returns a list with the value at the given index removed. -
coll.sort()--coll.sort(list :: LIST<ANY>) :: LIST<ANY>-- Returns a sorted list. -
keys()--keys(input :: NODE | RELATIONSHIP | MAP) :: LIST<STRING>-- Returns aLIST<STRING>containing theSTRINGrepresentations for all the property names of aMAP,NODE, orRELATIONSHIP. -
labels()--labels(input :: NODE) :: LIST<STRING>-- Returns aLIST<STRING>containing theSTRINGrepresentations for all the labels of aNODE. -
nodes()--nodes(input :: PATH) :: LIST<NODE>-- Returns aLIST<NODE>containing all theNODEvalues in aPATH. -
range()--range(start :: INTEGER, end :: INTEGER [, step :: INTEGER]) :: LIST<INTEGER>-- Returns aLIST<INTEGER>comprising allINTEGERvalues within a specified range, optionally specifying a step length. -
reduce()--reduce(accumulator :: VARIABLE = initial :: ANY, variable :: VARIABLE IN list :: LIST<ANY> expression :: ANY) :: ANY-- Runs an expression against individual elements of aLIST<ANY>, storing the result of the expression in an accumulator. -
relationships()--relationships(input :: PATH) :: LIST<RELATIONSHIP>-- Returns aLIST<RELATIONSHIP>containing all theRELATIONSHIPvalues in aPATH. -
reverse()--reverse(input :: LIST<ANY>) :: LIST<ANY>-- Returns aLIST<ANY>in which the order of all elements in the givenLIST<ANY>have been reversed. -
tail()--tail(input :: LIST<ANY>) :: LIST<ANY>-- Returns all but the first element in aLIST<ANY>. -
toBooleanList()--toBooleanList(input :: LIST<ANY>) :: LIST<BOOLEAN>-- Converts aLIST<ANY>of values to aLIST<BOOLEAN>values. If any values are not convertible toBOOLEANthey will be null in theLIST<BOOLEAN>returned. -
toFloatList()--toFloatList(input :: VECTOR | LIST<ANY>) :: LIST<FLOAT>-- Converts aLIST<ANY>to aLIST<FLOAT>values. If any values are not convertible toFLOATthey will be null in theLIST<FLOAT>returned. -
toIntegerList()--toIntegerList(input :: VECTOR | LIST<ANY>) :: LIST<INTEGER>-- Converts aLIST<ANY>to aLIST<INTEGER>values. If any values are not convertible toINTEGERthey will be null in theLIST<INTEGER>returned. -
toStringList()--toStringList(input :: LIST<ANY>) :: LIST<STRING>-- Converts aLIST<ANY>to aLIST<STRING>values. If any values are not convertible toSTRINGthey will be null in theLIST<STRING>returned.
LOAD CSV functions
LOAD CSV functions can be used to get information about the file that is processed by LOAD CSV.
-
file()--file() :: STRING-- Returns the absolute path of the file that LOAD CSV is using. -
linenumber()--linenumber() :: INTEGER-- Returns the line number that LOAD CSV is currently using.
Mathematical functions
Logarithmic functions
These functions all operate on numerical expressions only, and will return an error if used on any other values.
-
e()--e() :: FLOAT-- Returns the base of the natural logarithm, e. -
exp()--exp(input :: FLOAT) :: FLOAT-- Returns en, where e is the base of the natural logarithm, and n is the value of the argument expression. -
log()--log(input :: FLOAT) :: FLOAT-- Returns the natural logarithm of aFLOAT. -
log10()--log10(input :: FLOAT) :: FLOAT-- Returns the common logarithm (base 10) of aFLOAT. -
sqrt()--sqrt(input :: FLOAT) :: FLOAT-- Returns the square root of aFLOAT.
Numeric functions
These functions all operate on numerical expressions only, and will return an error if used on any other values.
-
abs()--abs(input :: INTEGER | FLOAT) :: INTEGER | FLOAT-- Returns the absolute value of anINTEGERorFLOAT. -
ceil()--ceil(input :: FLOAT) :: FLOAT-- Returns the smallestFLOATthat is greater than or equal to a number and equal to anINTEGER. -
floor()--floor(input :: FLOAT) :: FLOAT-- Returns the largestFLOATthat is less than or equal to a number and equal to anINTEGER. -
isNaN()--isNaN(input :: INTEGER | FLOAT) :: BOOLEAN-- Returnstrueif the floating point number isNaN. -
rand()--rand() :: FLOAT-- Returns a randomFLOATin the range from 0 (inclusive) to 1 (exclusive). -
round()--round(input :: FLOAT [, precision :: INTEGER | FLOAT, mode :: STRING]) :: FLOAT-- Returns the value of a number rounded to the nearestINTEGER, optionally using a specified precision and rounding mode. -
sign()--sign(input :: INTEGER | FLOAT) :: INTEGER-- Returns the signum of anINTEGERorFLOAT: 0 if the number is 0, -1 for any negative number, and 1 for any positive number.
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.
-
acos()--acos(input :: FLOAT) :: FLOAT-- Returns the arccosine of aFLOATin radians. -
asin()--asin(input :: FLOAT) :: FLOAT-- Returns the arcsine of aFLOATin radians. -
atan()--atan(input :: FLOAT) :: FLOAT-- Returns the arctangent of aFLOATin radians. -
atan2()--atan2(y :: FLOAT, x :: FLOAT) :: FLOAT-- Returns the arctangent2 of a set of coordinates in radians. -
cos()--cos(input :: FLOAT) :: FLOAT-- Returns the cosine of aFLOAT. -
cosh()--cosh(input :: FLOAT) :: FLOAT-- Returns the hyperbolic cosine of aFLOAT. Cypher 25 only Introduced in Neo4j 2025.06 -
cot()--cot(input :: FLOAT) :: FLOAT-- Returns the cotangent of aFLOAT. -
coth()--coth(input :: FLOAT) :: FLOAT-- Returns the hyperbolic cotangent of aFLOAT. Cypher 25 only Introduced in Neo4j 2025.06 -
degrees()--degrees(input :: FLOAT) :: FLOAT-- Converts radians to degrees. -
haversin()--haversin(input :: FLOAT) :: FLOAT-- Returns half the versine of a number. -
pi()--pi() :: FLOAT-- Returns the mathematical constant pi. -
radians()--radians(input :: FLOAT) :: FLOAT-- Converts degrees to radians. -
sin()--sin(input :: FLOAT) :: FLOAT-- Returns the sine of aFLOAT. -
sinh()--sinh(input :: FLOAT) :: FLOAT-- Returns the hyperbolic sine of aFLOAT. Cypher 25 only Introduced in Neo4j 2025.06 -
tan()--tan(input :: FLOAT) :: FLOAT-- Returns the tangent of aFLOAT. -
tanh()--tanh(input :: FLOAT) :: FLOAT-- Returns the hyperbolic tangent of aFLOAT. Cypher 25 only Introduced in Neo4j 2025.06
Predicate functions
These functions return either true or false for the given arguments.
-
all()--all(variable :: ANY, list :: LIST<ANY>, predicate :: ANY) :: BOOLEAN-- Returns true if the predicate holds for all elements in the givenLIST<ANY>. -
allReduce()--allReduce(accumulator = initial, stepVariable IN list | reductionFunction, predicate) :: BOOLEAN-- Returns true if, during the stepwise evaluation of a value across the elements in a givenLIST<ANY>, the accumulated result satisfies a specified predicate at every step. Where that list is a group variable defined in a quantified path pattern, it allows for the early pruning of paths that do not satisfy the predicate. Cypher 25 only Introduced in Neo4j 2025.08 -
any()--any(variable :: ANY, list :: LIST<ANY>, predicate :: ANY) :: BOOLEAN-- Returns true if the predicate holds for at least one element in the givenLIST<ANY>. -
exists()--exists(input :: ANY) :: BOOLEAN-- Returnstrueif a match for the pattern exists in the graph. -
isEmpty()--isEmpty(input :: LIST<ANY> | MAP | STRING ) :: BOOLEAN-- Checks whether the givenLIST<ANY>,MAP, orSTRINGis empty. -
none()--none(variable :: ANY, list :: LIST<ANY>, predicate :: ANY) :: BOOLEAN-- Returns true if the predicate holds for no element in the givenLIST<ANY>. -
single()--single(variable :: ANY, list :: LIST<ANY>, predicate :: ANY) :: BOOLEAN-- Returns true if the predicate holds for exactly one of the elements in the givenLIST<ANY>.
Scalar functions
These functions return a single value.
-
char_length()--char_length(input :: STRING) :: INTEGER-- Returns the number of Unicode characters in aSTRING. -
character_length()--character_length(input :: STRING) :: INTEGER-- Returns the number of Unicode characters in aSTRING. -
coalesce()--coalesce(input :: ANY) :: ANY-- Returns the first non-null value in a list of expressions. -
elementId()--elementId(input :: NODE | RELATIONSHIP) :: STRING-- Returns a node or relationship identifier, unique within a specific transaction and DBMS. -
endNode()--endNode(input :: RELATIONSHIP) :: NODE-- Returns the endNODEof aRELATIONSHIP. -
head()--head(list :: LIST<ANY>) :: ANY-- Returns the first element in aLIST<ANY>. -
id()--id(input :: NODE | RELATIONSHIP) :: INTEGER-- - [ ] Deprecated Returns the id of aNODEor aRELATIONSHIP. Replaced byelementId(). -- - [x]last()--last(list :: LIST<ANY>) :: ANY -- Returns the last element in aLIST`. -
length()--length(input :: PATH) :: INTEGER-- Returns the length of aPATH. -
nullIf()--nullIf(v1 :: ANY, v2 :: ANY) :: ANY-- Returnsnullif the two given parameters are equivalent, otherwise returns the value of the first parameter. -
properties()--properties(input :: NODE | RELATIONSHIP | MAP) :: MAP-- Returns aMAPcontaining all the properties of aNODEorRELATIONSHIP. -
randomUUID()--randomUUID() :: STRING-- Generates a random UUID. -
size()--size(input STRING | LIST<ANY>) :: INTEGER-- Returns the number of items in aLIST<ANY>or the number of Unicode characters in aSTRING. -
startNode()--startNode(input :: RELATIONSHIP) :: NODE-- Returns the startNODEof aRELATIONSHIP. -
timestamp()--timestamp() :: INTEGER-- Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. -
toBoolean()--toBoolean(input :: BOOLEAN | STRING | INTEGER) :: BOOLEAN-- Converts aBOOLEAN,STRING, or anINTEGERvalue to aBOOLEANvalue. -
toBooleanOrNull()--toBooleanOrNull(input :: ANY) :: BOOLEAN-- Converts a value to aBOOLEANvalue, or null if the value cannot be converted. -
toFloat()--toFloat(input :: STRING | INTEGER | FLOAT) :: FLOAT-- Converts aSTRINGorINTEGERvalue to aFLOATvalue. -
toFloatOrNull()--toFloatOrNull(input :: ANY) :: FLOAT-- Converts a value to aFLOATvalue, or null if the value cannot be converted. -
toInteger()--toInteger(input :: BOOLEAN | STRING | INTEGER | FLOAT) :: INTEGER-- Converts aBOOLEAN, `STRING, orFLOATvalue to anINTEGERvalue. -
toIntegerOrNull()--toIntegerOrNull(input :: ANY) :: INTEGER-- Converts a value to anINTEGERvalue, or null if the value cannot be converted. -
type()--type(input :: RELATIONSHIP) :: STRING-- Returns aSTRINGrepresentation of theRELATIONSHIPtype. -
valueType()--valueType(input :: ANY) :: STRING-- Returns aSTRINGrepresentation of the most precise value type that the given expression evaluates to.
String functions
These functions are used to manipulate STRING values or to create a STRING representation of another value.
-
btrim()--btrim(original :: STRING [, trimCharacterString :: STRING ]) :: STRING-- Returns the givenSTRINGwith leading and trailing whitespace removed, optionally specifying atrimCharacterStringvalue to remove. -
left()--left(original :: STRING, length :: INTEGER) :: STRING-- Returns aSTRINGcontaining the specified number (INTEGER) of leftmost characters in the givenSTRING. -
lower()--lower(input :: STRING) :: STRING-- - [ ] Returns the givenSTRINGin lowercase. This function is an alias to thetoLower()function, and it was introduced as part of Cypher’s GQL conformance -- -
ltrim()--ltrim(input :: STRING [, trimCharacterString :: STRING]) :: STRING -- Returns the givenSTRINGwith leading whitespace removed, optionally specifying atrimCharacterString` to remove. -
normalize()--normalize(input :: STRING [,normalForm = NFC :: [NFC, NFD, NFKC, NFKD]]) :: STRING-- Normalizes aSTRING, optionally specifying a normalization form. -
replace()--replace(original :: STRING, search :: STRING, replace :: STRING) :: STRING-- Returns aSTRINGin which all occurrences of a specified searchSTRINGin the givenSTRINGhave been replaced by another (specified) replacementSTRING. -
reverse()--reverse(input :: STRING) :: STRING-- Returns aSTRINGin which the order of all characters in the givenSTRINGhave been reversed. -
right()--right(original :: STRING, length :: INTEGER) :: STRING-- Returns aSTRINGcontaining the specified number of rightmost characters in the givenSTRING. -
rtrim()--rtrim(input :: STRING [, trimCharacterString :: STRING]) :: STRING-- Returns the givenSTRINGwith trailing whitespace removed, optionally specifying atrimCharacterStringof characters to remove. -
split()--split(original :: STRING, splitDelimiters :: LIST<STRING>) :: LIST<STRING>-- Returns aLIST<STRING>resulting from the splitting of the givenSTRINGaround matches of any of the given delimiters. -
substring()--substring(original :: STRING, start :: INTEGER length :: INTEGER) :: STRING-- Returns a substring of a givenlengthfrom the givenSTRING, beginning with a 0-based index start. -
toLower()--toLower(input :: STRING) :: STRING-- Returns the givenSTRINGin lowercase. -
toString()--toString(input :: ANY) :: STRING-- Converts anINTEGER,FLOAT,BOOLEAN,POINTor temporal type (i.e.DATE,ZONED TIME,LOCAL TIME,ZONED DATETIME,LOCAL DATETIMEorDURATION) value to aSTRING. -
toStringOrNull()--toStringOrNull(input :: ANY) :: STRING-- Converts anINTEGER,FLOAT,BOOLEAN,POINTor temporal type (i.e.DATE,ZONED TIME,LOCAL TIME,ZONED DATETIME,LOCAL DATETIMEorDURATION) value to aSTRING, or null if the value cannot be converted. -
toUpper()--toUpper(input :: STRING) :: STRING-- Returns the givenSTRINGin uppercase. -
trim()--trim(trimCharacterString :: STRING, trimSpecification :: STRING, input :: STRING) :: STRING-- Returns the givenSTRINGwith the leading and/or trailingtrimCharacterStringcharacter removed. -
upper()--upper(input :: STRING) :: STRING-- - [ ] Returns the givenSTRINGin uppercase. This function is an alias to thetoUpper()function, and it was introduced as part of Cypher’s GQL conformance --
Spatial function -- ----------------------------------------------------
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.
-
point()--point(input :: MAP) :: POINT-- 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. -
point.distance()--point.distance(from :: POINT, to :: POINT) :: FLOAT-- Returns aFLOATrepresenting the distance between any two points in the same CRS. If the points are in the WGS 84 CRS, the function returns the geodesic distance (i.e., the shortest path along the curved surface of the Earth). If the points are in a Cartesian CRS, the function returns the Euclidean distance (i.e., the shortest straight-line distance in a flat, planar space). -
point.withinBBox()--point.withinBBox(point :: POINT, lowerLeft :: POINT, upperRight :: POINT) :: BOOLEAN-- Returnstrueif the provided point is within the bounding box defined by the two provided points,lowerLeftandupperRight.
Temporal functions
Duration functions
DURATION values of the temporal types can be created manipulated using the following functions:
-
duration()--duration(input :: ANY) :: DURATION-- Constructs aDURATIONvalue. -
duration.between()--duration.between(from :: ANY, to :: ANY) :: DURATION-- Computes theDURATIONbetween thefrominstant (inclusive) and thetoinstant (exclusive) in logical units. -
duration.inDays()--duration.inDays(from :: ANY, to :: ANY) :: DURATION-- Computes theDURATIONbetween thefrominstant (inclusive) and thetoinstant (exclusive) in days. -
duration.inMonths()--duration.inMonths(from :: ANY, to :: ANY) :: DURATION-- Computes theDURATIONbetween thefrominstant (inclusive) and thetoinstant (exclusive) in months. -
duration.inSeconds()--duration.inSeconds(from :: ANY, to :: ANY) :: DURATION-- Computes theDURATIONbetween thefrominstant (inclusive) and thetoinstant (exclusive) in seconds.
Instant type functions
Values of the temporal types — DATE, ZONED TIME, LOCAL TIME, ZONED DATETIME, and LOCAL DATETIME — can be created manipulated using the following functions:
-
date()--date(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: DATE-- Creates aDATEinstant. -
date.realtime()--date.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: DATE-- Returns the currentDATEinstant using the realtime clock. -
date.statement()--date.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: DATE-- Returns the currentDATEinstant using the statement clock. -
date.transaction()--date.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: DATE-- Returns the currentDATEinstant using the transaction clock. -
date.truncate()--date.truncate(unit :: STRING, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY, fields = null :: MAP) :: DATE-- Truncates the given temporal value to aDATEinstant using the specified unit. -
datetime()--datetime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED DATETIME-- Creates aZONED DATETIMEinstant. -
datetime.fromEpoch()--datetime.fromEpoch(seconds :: INTEGER | FLOAT, nanoseconds :: INTEGER | FLOAT) :: ZONED DATETIME-- Creates aZONED DATETIMEgiven the seconds and nanoseconds since the start of the epoch. -
datetime.fromEpochMillis()--datetime.fromEpochMillis(milliseconds :: INTEGER | FLOAT) :: ZONED DATETIME-- Creates aZONED DATETIMEgiven the milliseconds since the start of the epoch. -
datetime.realtime()--datetime.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED DATETIME-- Returns the currentZONED DATETIMEinstant using the realtime clock. -
datetime.statement()--datetime.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED DATETIME-- Returns the currentZONED DATETIMEinstant using the statement clock. -
datetime.transaction()--datetime.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED DATETIME-- Returns the currentZONED DATETIMEinstant using the transaction clock. -
datetime.truncate()--datetime.truncate(unit :: STRING, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY, fields = null :: MAP) :: ZONED DATETIME-- Truncates the given temporal value to aZONED DATETIMEinstant using the specified unit. -
localdatetime()--localdatetime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL DATETIME-- Creates aLOCAL DATETIMEinstant. -
localdatetime.realtime()--localdatetime.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL DATETIME-- Returns the currentLOCAL DATETIMEinstant using the realtime clock. -
localdatetime.statement()--localdatetime.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL DATETIME-- Returns the currentLOCAL DATETIMEinstant using the statement clock. -
localdatetime.transaction()--localdatetime.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL DATETIME-- Returns the currentLOCAL DATETIMEinstant using the transaction clock. -
localdatetime.truncate()--localdatetime.truncate(unit :: STRING, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY, fields = null :: MAP) :: LOCAL DATETIME-- Truncates the given temporal value to aLOCAL DATETIMEinstant using the specified unit. -
localtime()--localtime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL TIME-- Creates aLOCAL TIMEinstant. -
localtime.realtime()--localtime.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL TIME-- Returns the currentLOCAL TIMEinstant using the realtime clock. -
localtime.statement()--localtime.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL TIME-- Returns the currentLOCAL TIMEinstant using the statement clock. -
localtime.transaction()--localtime.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: LOCAL TIME-- Returns the currentLOCAL TIMEinstant using the transaction clock. -
localtime.truncate()--localtime.truncate(unit :: STRING, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY, fields = null :: MAP) :: LOCAL TIME-- Truncates the given temporal value to aLOCAL TIMEinstant using the specified unit. -
time()--time(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED TIME-- Creates aZONED TIMEinstant. -
time.realtime()--time.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED TIME-- Returns the currentZONED TIMEinstant using the realtime clock. -
time.statement()--time.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED TIME-- Returns the currentZONED TIMEinstant using the statement clock. -
time.transaction()--time.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY) :: ZONED TIME-- Returns the currentZONED TIMEinstant using the transaction clock. -
time.truncate()--time.truncate(unit :: STRING, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY, fields = null :: MAP) :: ZONED TIME-- Truncates the given temporal value to aZONED TIMEinstant using the specified unit.
Format functions
These functions format temporal instance and duration values:
-
format()--format(value :: DATE | LOCAL TIME | ZONED TIME | LOCAL DATETIME | ZONED DATETIME | DURATION[, pattern :: STRING]) :: STRING-- Returns the temporal value as an ISO-formattedSTRINGor as aSTRINGformatted by the provided pattern.
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:
Vector functions
Vector functions allow you to compute the similarity scores of vector pairs.
-
vector()--vector(vectorValue :: STRING | LIST<INTEGER | FLOAT>, dimension :: INTEGER, coordinateType :: [INTEGER64, INTEGER32, INTEGER16, INTEGER8, FLOAT64, FLOAT32]) :: VECTOR -- Constructs aVECTOR` value. Cypher 25 only Introduced in Neo4j 2025.10 -
vector.similarity.cosine()--vector.similarity.cosine(a :: VECTOR | LIST<INTEGER | FLOAT>, b :: VECTOR | LIST<INTEGER | FLOAT>) :: FLOAT-- Returns aFLOATrepresenting the similarity between the argument vectors based on their cosine. -
vector.similarity.euclidean()--vector.similarity.euclidean(a :: VECTOR | LIST<INTEGER | FLOAT>, b :: VECTOR | LIST<INTEGER | FLOAT>) :: FLOAT-- Returns aFLOATrepresenting the similarity between the argument vectors based on their Euclidean distance. -
vector_dimension_count()--(vector :: VECTOR) :: INTEGER-- Returns the dimension of aVECTOR. Cypher 25 only Introduced in Neo4j 2025.10 -
vector_distance()--(vector1 :: VECTOR, vector2 :: VECTOR, vectorDistanceMetric :: [EUCLIDEAN, EUCLIDEAN_SQUARED, MANHATTAN, COSINE, DOT, HAMMING]) :: FLOAT-- Returns aFLOATrepresenting the distance between the two vector values based on the selectedvectorDistanceMetricalgorithm. Cypher 25 only Introduced in Neo4j 2025.10 -
vector_norm()--vector_norm(vector :: VECTOR, vectorDistanceMetric :: [EUCLIDEAN, MANHATTAN]) :: FLOAT-- Returns aFLOATrepresenting the distance between the given vector and a vector of the same dimension with all coordinates set to zero, calculated using the specifiedvectorDistanceMetric. Cypher 25 only Introduced in Neo4j 2025.10