Graph Database (13): Functions in Neo4j

Including numeric functions, character functions, time functions, list functions and aggregate functions, etc. 

Functions

Function Category Description

abs()

Numeric

Returns the absolute value of a number.

acos()

Trigonometric

Returns the arccosine of a number in radians.

all()

Predicate

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

any()

Predicate

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

asin()

Trigonometric

Returns the arcsine of a number in radians.

assign()

Trigonometric

Returns the arctangent of a number in radians.

atan2()

Trigonometric

Returns the arctangent2 of a set of coordinates in radians.

avg()

Aggregating

Returns the average of a set of values.

ceil()

Numeric

Returns the smallest floating point number that is greater than or equal to a number and equal to a mathematical integer.

coalesce()

Scalar

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

collect()

Aggregating

Returns a list containing the values returned by an expression.

cos()

Trigonometric

Returns the cosine of a number.

cot()

Trigonometric

Returns the cotangent of a number.

count()

Aggregating

Returns the number of values or rows.

date()

Temporal

Returns the current Date.

date({year [, month, day]})

Temporal

Returns a calendar (Year-Month-Day) Date.

date({year [, week, dayOfWeek]})

Temporal

Returns a week (Year-Week-Day) Date.

date({year [, quarter, dayOfQuarter]})

Temporal

Returns a quarter (Year-Quarter-Day) Date.

date({year [, ordinalDay]})

Temporal

Returns an ordinal (Year-Day) Date.

date(string)

Temporal

Returns a Date by parsing a string.

date({map})

Temporal

Returns a Date from a map of another temporal value’s components.

date.realtime()

Temporal

Returns the current Date using the realtime clock.

date.statement()

Temporal

Returns the current Date using the statement clock.

date.transaction()

Temporal

Returns the current Date using the transaction clock.

date.truncate()

Temporal

Returns a Date obtained by truncating a value at a specific component boundary. Truncation summary.

datetime()

Temporal

Returns the current DateTime.

datetime({year [, month, day, …​]})

Temporal

Returns a calendar (Year-Month-Day) DateTime.

datetime({year [, week, dayOfWeek, …​]})

Temporal

Returns a week (Year-Week-Day) DateTime.

datetime({year [, quarter, dayOfQuarter, …​]})

Temporal

Returns a quarter (Year-Quarter-Day) DateTime.

datetime({year [, ordinalDay, …​]})

Temporal

Returns an ordinal (Year-Day) DateTime.

datetime(string)

Temporal

Returns a DateTime by parsing a string.

datetime({map})

Temporal

Returns a DateTime from a map of another temporal value’s components.

datetime({epochSeconds})

Temporal

Returns a DateTime from a timestamp.

datetime.realtime()

Temporal

Returns the current DateTime using the realtime clock.

datetime.statement()

Temporal

Returns the current DateTime using the statement clock.

datetime.transaction()

Temporal

Returns the current DateTime using the transaction clock.

datetime.truncate()

Temporal

Returns a DateTime obtained by truncating a value at a specific component boundary. Truncation summary.

degrees()

Trigonometric

Converts radians to degrees.

duration({map})

Temporal

Returns a Duration from a map of its components.

duration(string)

Temporal

Returns a Duration by parsing a string.

duration.between()

Temporal

Returns a Duration equal to the difference between two given instants.

duration.inDays()

Temporal

Returns a Duration equal to the difference in whole days or weeks between two given instants.

duration.inMonths()

Temporal

Returns a Duration equal to the difference in whole months, quarters or years between two given instants.

duration.inSeconds()

Temporal

Returns a Duration equal to the difference in seconds and fractions of seconds, or minutes or hours, between two given instants.

e()

Logarithmic

Returns the base of the natural logarithm, e.

endNode()

Scalar

Returns the end node of a relationship.

exists()

Predicate

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

exp()

Logarithmic

Returns e^n, where e is the base of the natural logarithm, and n is the value of the argument expression.

floor()

Numeric

Returns the largest floating point number that is less than or equal to a number and equal to a mathematical integer.

haversin()

Trigonometric

Returns half the versine of a number.

head()

Scalar

Returns the first element in a list.

id()

Scalar

Returns the id of a relationship or node.

isEmpty()

Predicate

Returns true if the given list or map contains no elements or if the given string contains no characters.

keys()

List

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

labels()

List

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

last()

Scalar

Returns the last element in a list.

left()

String

Returns a string containing the specified number of leftmost characters of the original string.

length()

Scalar

Returns the length of a path.

localdatetime()

Temporal

Returns the current LocalDateTime.

localdatetime({year [, month, day, …​]})

Temporal

Returns a calendar (Year-Month-Day) LocalDateTime.

localdatetime({year [, week, dayOfWeek, …​]})

Temporal

Returns a week (Year-Week-Day) LocalDateTime.

localdatetime({year [, quarter, dayOfQuarter, …​]})

Temporal

Returns a quarter (Year-Quarter-Day) DateTime.

localdatetime({year [, ordinalDay, …​]})

Temporal

Returns an ordinal (Year-Day) LocalDateTime.

localdatetime(string)

Temporal

Returns a LocalDateTime by parsing a string.

localdatetime({map})

Temporal

Returns a LocalDateTime from a map of another temporal value’s components.

localdatetime.realtime()

Temporal

Returns the current LocalDateTime using the realtime clock.

localdatetime.statement()

Temporal

Returns the current LocalDateTime using the statement clock.

localdatetime.transaction()

Temporal

Returns the current LocalDateTime using the transaction clock.

localdatetime.truncate()

Temporal

Returns a LocalDateTime obtained by truncating a value at a specific component boundary. Truncation summary.

localtime()

Temporal

Returns the current LocalTime.

localtime({hour [, minute, second, …​]})

Temporal

Returns a LocalTime with the specified component values.

localtime(string)

Temporal

Returns a LocalTime by parsing a string.

localtime({time [, hour, …​]})

Temporal

Returns a LocalTime from a map of another temporal value’s components.

localtime.realtime()

Temporal

Returns the current LocalTime using the realtime clock.

localtime.statement()

Temporal

Returns the current LocalTime using the statement clock.

localtime.transaction()

Temporal

Returns the current LocalTime using the transaction clock.

localtime.truncate()

Temporal

Returns a LocalTime obtained by truncating a value at a specific component boundary. Truncation summary.

log()

Logarithmic

Returns the natural logarithm of a number.

log10()

Logarithmic

Returns the common logarithm (base 10) of a number.

lTrim()

String

Returns the original string with leading whitespace removed.

max()

Aggregating

Returns the maximum value in a set of values.

min()

Aggregating

Returns the minimum value in a set of values.

nodes()

List

Returns a list containing all the nodes in a path.

none()

Predicate

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

percentileCont()

Aggregating

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

percentileDisc()

Aggregating

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

pi()

Trigonometric

Returns the mathematical constant pi.

point() - Cartesian 2D

Spatial

Returns a 2D point object, given two coordinate values in the Cartesian coordinate system.

point() - Cartesian 3D

Spatial

Returns a 3D point object, given three coordinate values in the Cartesian coordinate system.

point() - WGS 84 2D

Spatial

Returns a 2D point object, given two coordinate values in the WGS 84 coordinate system.

point() - WGS 84 3D

Spatial

Returns a 3D point object, given three coordinate values in the WGS 84 coordinate system.

point.distance()

Spatial

Returns true if the provided point is within the bounding box defined by the two provided points.

point.withinBBox()

Spatial

Returns a floating point number representing the geodesic distance between any two points in the same CRS.

properties()

Scalar

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

radians()

Trigonometric

Converts degrees to radians.

rand()

Numeric

Returns a random floating point number in the range from 0 (inclusive) to 1 (exclusive); i.e. [0, 1).

randomUUID()

Scalar

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

range()

List

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

reduce()

List

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

relationships()

List

Returns a list containing all the relationships in a path.

replace()

String

Returns a string in which all occurrences of a specified string in the original string have been replaced by another (specified) string.

reverse()

List

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

reverse()

String

Returns a string in which the order of all characters in the original string have been reversed.

right()

String

Returns a string containing the specified number of rightmost characters of the original string.

round()

Numeric

Returns the value of the given number rounded to the nearest integer, with half-way values always rounded up.

round(), with precision

Numeric

Returns the value of the given number rounded with the specified precision, with half-values always being rounded up.

round(), with precision and rounding mode

Numeric

Returns the value of the given number rounded with the specified precision and the specified rounding mode.

rTrim()

String

Returns the original string with trailing whitespace removed.

sign()

Numeric

Returns the signum of a number: 0 if the number is 0-1 for any negative number, and 1 for any positive number.

sin()

Trigonometric

Returns the sine of a number.

single()

Predicate

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

size()

Scalar

Returns the number of items in a list.

size() applied to pattern expression

Scalar

Returns the number of paths matching the pattern expression.

size() applied to string

Scalar

Returns the number of Unicode characters in a string.

split()

String

Returns a list of strings resulting from the splitting of the original string around matches of the given delimiter.

sqrt()

Logarithmic

Returns the square root of a number.

startNode()

Scalar

Returns the start node of a relationship.

stDev()

Aggregating

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

stDevP()

Aggregating

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

substring()

String

Returns a substring of the original string, beginning with a 0-based index start and length.

sum()

Aggregating

Returns the sum of a set of numeric values.

tail()

List

Returns all but the first element in a list.

tan()

Trigonometric

Returns the tangent of a number.

time()

Temporal

Returns the current Time.

time({hour [, minute, …​]})

Temporal

Returns a Time with the specified component values.

time(string)

Temporal

Returns a Time by parsing a string.

time({time [, hour, …​, timezone]})

Temporal

Returns a Time from a map of another temporal value’s components.

time.realtime()

Temporal

Returns the current Time using the realtime clock.

time.statement()

Temporal

Returns the current Time using the statement clock.

time.transaction()

Temporal

Returns the current Time using the transaction clock.

time.truncate()

Temporal

Returns a Time obtained by truncating a value at a specific component boundary. Truncation summary.

timestamp()

Scalar

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

toBoolean()

Scalar

Converts a string value to a boolean value.

toFloat()

Scalar

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

toInteger()

Scalar

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

toLower()

String

Returns the original string in lowercase.

toString()

String

Converts an integer, float, boolean or temporal (i.e. Date, Time, LocalTime, DateTime, LocalDateTime or Duration) value to a string.

toUpper()

String

Returns the original string in uppercase.

trim()

String

Returns the original string with leading and trailing whitespace removed.

type()

Scalar

Returns the string representation of the relationship type.

Guess you like

Origin blog.csdn.net/weixin_43145427/article/details/124269760