Procedures & Functions

This is the page for APOC Core documentation. For APOC Extended, go to the APOC Extended page.

apoc

Qualified Name Type

apoc.case(conditionals LIST<ANY>, elseQuery STRING, params MAP) - for each pair of conditional and read-only queries in the given LIST<ANY>, this procedure will run the first query for which the conditional is evaluated to true. If none of the conditionals are true, the ELSE query will run instead.

Procedure

apoc.help() - returns descriptions of the available APOC procedures and functions. If a keyword is provided, it will return only those procedures and functions that have the keyword in their name.

Procedure

apoc.version() - returns the APOC version currently installed.

Function

apoc.when(condition BOOLEAN, ifQuery STRING, elseQuery STRING, params MAP<STRING, ANY>) - this procedure will run the read-only ifQuery if the conditional has evaluated to true, otherwise the elseQuery will run.

Procedure

apoc.agg

Qualified Name Type

apoc.agg.first(value ANY) - returns the first value from the given collection.

Function

apoc.agg.graph(path ANY) - returns all distinct NODE and RELATIONSHIP values collected into a MAP with the keys nodes and relationships.

Function

apoc.agg.last(value ANY) - returns the last value from the given collection.

Function

apoc.agg.maxItems(items ANY, value ANY, groupLimit INTEGER) - returns a MAP {items: LIST<ANY>, value: ANY} where the value key is the maximum value present, and items represent all items with the same value. The size of the list of items can be limited to a given max size.

Function

apoc.agg.median(value ANY) - returns the mathematical median for all non-null INTEGER and FLOAT values.

Function

apoc.agg.minItems(items ANY, value ANY, groupLimit INTEGER) - returns a MAP {items: LIST<ANY>, value: ANY} where the value key is the minimum value present, and items represent all items with the same value. The size of the list of items can be limited to a given max size.

Function

apoc.agg.nth(value ANY, offset INTEGER) - returns the nth value in the given collection (to fetch the last item of an unknown length collection, -1 can be used).

Function

apoc.agg.percentiles(value INTEGER | FLOAT, percentiles LIST<FLOAT>) - returns the given percentiles over the range of numerical values in the given collection.

Function

apoc.agg.product(value INTEGER | FLOAT) - returns the product of all non-null INTEGER and FLOAT values in the collection.

Function

apoc.agg.slice(value ANY, from INTEGER, to INTEGER) - returns subset of non-null values from the given collection (the collection is considered to be zero-indexed). To specify the range from start until the end of the collection, the length should be set to -1.

Function

apoc.agg.statistics(value INTEGER | FLOAT, percentiles LIST<FLOAT>) - returns the following statistics on the INTEGER and FLOAT values in the given collection: percentiles, min, minNonZero, max, total, mean, stdev.

Function

apoc.algo

Qualified Name Type

apoc.algo.aStar(startNode NODE, endNode NODE, relTypesAndDirections STRING, weightPropertyName STRING, latPropertyName STRING, lonPropertyName STRING) - runs the A* search algorithm to find the optimal path between two NODE values, using the given RELATIONSHIP property name for the cost function.

Procedure

apoc.algo.aStarConfig(startNode NODE, endNode NODE, relTypesAndDirections STRING, config MAP<STRING, ANY>) - runs the A* search algorithm to find the optimal path between two NODE values, using the given RELATIONSHIP property name for the cost function. This procedure looks for weight, latitude and longitude properties in the config.

Procedure

apoc.algo.allSimplePaths(startNode NODE, endNode NODE, relTypesAndDirections STRING, maxNodes INTEGER) - runs a search algorithm to find all of the simple paths between the given RELATIONSHIP values, up to a max depth described by maxNodes. The returned paths will not contain loops.

Procedure

apoc.algo.cover(nodes ANY) - returns all RELATIONSHIP values connecting the given set of NODE values.

Procedure

apoc.algo.dijkstra(startNode NODE, endNode NODE, relTypesAndDirections STRING, weightPropertyName STRING, defaultWeight FLOAT, numberOfWantedPaths INTEGER) - runs Dijkstra’s algorithm using the given RELATIONSHIP property as the cost function.

Procedure

apoc.any

Qualified Name Type

apoc.any.isDeleted(object ANY) - returns true if the given NODE or RELATIONSHIP no longer exists.

Function

apoc.any.properties(object ANY, keys LIST<STRING>) - returns all properties of the given object. The object can be a virtual NODE, a real NODE, a virtual RELATIONSHIP, a real RELATIONSHIP, or a MAP.

Function

apoc.any.property(object ANY, key STRING) - returns the property for the given key from an object. The object can be a virtual NODE, a real NODE, a virtual RELATIONSHIP, a real RELATIONSHIP, or a MAP.

Function

apoc.atomic

Qualified Name Type

apoc.atomic.add(container ANY, propertyName STRING, number INTEGER | FLOAT, retryAttempts INTEGER) - sets the given property to the sum of itself and the given INTEGER or FLOAT value. The procedure then sets the property to the returned sum.

Procedure

apoc.atomic.concat(container ANY, propertyName STRING, string STRING, retryAttempts INTEGER) - sets the given property to the concatenation of itself and the STRING value. The procedure then sets the property to the returned STRING.

Procedure

apoc.atomic.insert(container ANY, propertyName STRING, position INTEGER, value ANY, retryAttempts INTEGER) - inserts a value at position into the LIST<ANY> value of a property. The procedure then sets the result back on the property.

Procedure

apoc.atomic.remove(container ANY, propertyName STRING, position INTEGER, retryAttempts INTEGER) - removes the element at position from the LIST<ANY> value of a property. The procedure then sets the property to the resulting LIST<ANY> value.

Procedure

apoc.atomic.subtract(container ANY, propertyName STRING, number INTEGER | FLOAT, retryAttempts INTEGER) - sets the property of a value to itself minus the given INTEGER or FLOAT value. The procedure then sets the property to the returned sum.

Procedure

apoc.atomic.update(container ANY, propertyName STRING, operation STRING, retryAttempts INTEGER) - updates the value of a property with a Cypher operation.

Procedure

apoc.bitwise

Qualified Name Type

apoc.bitwise.op(a INTEGER, operator STRING, b INTEGER) - returns the result of the bitwise operation.

Function

apoc.coll

Qualified Name Type

apoc.coll.elements(coll LIST<ANY>, limit INTEGER, offset INTEGER) - deconstructs a LIST<ANY> into identifiers indicating their specific type.

Procedure

apoc.coll.split(coll LIST<ANY>, value ANY) - splits a collection by the given value. The value itself will not be part of the resulting LIST<ANY> values.

Procedure

apoc.coll.zipToRows apoc.coll.zipToRows(list1 LIST<ANY>, list2 LIST<ANY>) - returns the two LIST<ANY> values zipped together, with one row per zipped pair.

Procedure

apoc.coll.avg(coll LIST<INTEGER | FLOAT>) - returns the average of the numbers in the LIST<INTEGER | FLOAT>.

Function

apoc.coll.combinations(coll LIST<ANY>, minSelect INTEGER, maxSelect INTEGER) - returns a collection of all combinations of LIST<ANY> elements between the selection size minSelect and maxSelect (default: minSelect).

Function

apoc.coll.contains(coll LIST<ANY>, value ANY) - returns whether or not the given value exists in the given collection (using a HashSet).

Function

apoc.coll.containsAll(coll1 LIST<ANY>, coll2 LIST<ANY>) - returns whether or not all of the given values exist in the given collection (using a HashSet).

Function

apoc.coll.containsAllSorted(coll1 LIST<ANY>, coll2 LIST<ANY>) - returns whether or not all of the given values in the second LIST<ANY> exist in an already sorted collection (using a binary search).

Function

apoc.coll.containsDuplicates(coll LIST<ANY>) - returns true if a collection contains duplicate elements.

Function

apoc.coll.containsSorted(coll LIST<ANY>, value ANY) - returns whether or not the given value exists in an already sorted collection (using a binary search).

Function

apoc.coll.different(coll LIST<ANY>) - returns true if all the values in the given LIST<ANY> are unique.

Function

apoc.coll.disjunction(list1 LIST<ANY>, list2 LIST<ANY>) - returns the disjunct set from two LIST<ANY> values.

Function

apoc.coll.dropDuplicateNeighbors(list LIST<ANY>) - removes duplicate consecutive objects in the LIST<ANY>.

Function

apoc.coll.duplicates(coll LIST<ANY>) - returns a LIST<ANY> of duplicate items in the collection.

Function

apoc.coll.duplicatesWithCount(coll LIST<ANY>) - returns a LIST<ANY> of duplicate items in the collection and their count, keyed by item and count.

Function

apoc.coll.fill(items STRING, count INTEGER) - returns a LIST<ANY> with the given count of items.

Function

apoc.coll.flatten(coll LIST<ANY>, recursive BOOLEAN) - flattens the given LIST<ANY> (to flatten nested LIST<ANY> values, set recursive to true).

Function

apoc.coll.frequencies(coll LIST<ANY>) - returns a LIST<ANY> of frequencies of the items in the collection, keyed by item and count.

Function

apoc.coll.frequenciesAsMap(coll LIST<ANY>) - returns a MAP of frequencies of the items in the collection, keyed by item and count.

Function

apoc.coll.indexOf(coll LIST<ANY>, value ANY) - returns the index for the first occurrence of the specified value in the LIST<ANY>.

Function

apoc.coll.insert(coll LIST<ANY>, index INTEGER, value ANY) - inserts a value into the specified index in the LIST<ANY>.

Function

apoc.coll.insertAll(coll LIST<ANY>, index INTEGER, values LIST<ANY>) - inserts all of the values into the LIST<ANY>, starting at the specified index.

Function

apoc.coll.intersection(list1 LIST<ANY>, list2 LIST<ANY>) - returns the distinct intersection of two LIST<ANY> values.

Function

apoc.coll.isEqualCollection(coll LIST<ANY>, values LIST<ANY>) - returns true if the two collections contain the same elements with the same cardinality in any order (using a HashMap).

Function

apoc.coll.max(values LIST<ANY>) - returns the maximum of all values in the given LIST<ANY>.

Function

apoc.coll.min(values LIST<ANY>) - returns the minimum of all values in the given LIST<ANY>.

Function

apoc.coll.occurrences(coll LIST<ANY>, item ANY) - returns the count of the given item in the collection.

Function

apoc.coll.pairs(list LIST<ANY>) - returns a LIST<ANY> of adjacent elements in the LIST<ANY> ([1,2],[2,3],[3,null]).

Function

apoc.coll.pairsMin(list LIST<ANY>) - returns LIST<ANY> values of adjacent elements in the LIST<ANY> ([1,2],[2,3]), skipping the final element.

Function

apoc.coll.pairWithOffset(coll LIST<ANY>, offset INTEGER) - returns a LIST<ANY> of pairs defined by the offset.

Function

apoc.coll.partition(coll LIST<ANY>, batchSize INTEGER) - partitions the original LIST<ANY> into a new LIST<ANY> of the given batch size. The final LIST<ANY> may be smaller than the given batch size.

Function

apoc.coll.randomItem(coll LIST<ANY>)- returns a random item from the LIST<ANY>, or null on LIST<NOTHING> or LIST<NULL>.

Function

apoc.coll.randomItems(coll LIST<ANY>, itemCount INTEGER, allowRepick BOOLEAN) - returns a LIST<ANY> of itemCount random items from the original LIST<ANY> (optionally allowing elements in the original LIST<ANY> to be selected more than once).

Function

apoc.coll.remove(coll LIST<ANY>, index INTEGER, length INTEGER) - removes a range of values from the LIST<ANY>, beginning at position index for the given length of values.

Function

apoc.coll.removeAll(list1 LIST<ANY>, list2 LIST<ANY>) - returns the first LIST<ANY> with all elements also present in the second LIST<ANY> removed.

Function

apoc.coll.runningTotal(list LIST<INTEGER | FLOAT>) - returns an accumulative LIST<INTEGER | FLOAT>.

Function

apoc.coll.set(coll LIST<ANY>, index INTEGER, value ANY) - sets the element at the given index to the new value.

Function

apoc.coll.shuffle(coll LIST<ANY>) - returns the LIST<ANY> shuffled.

Function

apoc.coll.sort(coll LIST<ANY>) - sorts the given LIST<ANY> into ascending order.

Function

apoc.coll.sortMaps(list LIST<MAP<STRING, ANY>>, prop STRING) - sorts the given LIST<MAP<STRING, ANY>> into descending order, based on the MAP property indicated by prop.

Function

apoc.coll.sortMulti(coll LIST<MAP<STRING, ANY>>, orderFields LIST<STRING>, limit INTEGER, skip INTEGER) - sorts the given LIST<MAP<STRING, ANY>> by the given fields. To indicate that a field should be sorted according to ascending values, prefix it with a caret (^). It is also possible to add limits to the LIST<MAP<STRING, ANY>> and to skip values.

Function

apoc.coll.sortNodes(coll LIST<NODE>, prop STRING) - sorts the given LIST<NODE> by the property of the nodes into descending order.

Function

apoc.coll.sortText(coll LIST<STRING>, conf MAP<STRING, ANY>) - sorts the given LIST<STRING> into ascending order.

Function

apoc.coll.stdev(list LIST<INTEGER | FLOAT>, isBiasCorrected BOOLEAN) - returns sample or population standard deviation with isBiasCorrected true or false respectively.

Function

apoc.coll.subtract(list1 LIST<ANY>, list2 LIST<ANY>) - returns the first LIST<ANY> as a set with all the elements of the second LIST<ANY> removed.

Function

apoc.coll.sum(coll LIST<INTEGER | FLOAT>) - returns the sum of all the INTEGER | FLOAT in the LIST<INTEGER | FLOAT>.

Function

apoc.coll.sumLongs(coll LIST<INTEGER | FLOAT>) - returns the sum of all the INTEGER | FLOAT in the LIST<INTEGER | FLOAT>.

Function

apoc.coll.toSet(coll LIST<ANY>) - returns a unique LIST<ANY> from the given LIST<ANY>.

Function

apoc.coll.union(list1 LIST<ANY>, list2 LIST<ANY>) - returns the distinct union of the two given LIST<ANY> values.

Function

apoc.coll.unionAll(list1 LIST<ANY>, list2 LIST<ANY>) - returns the full union of the two given LIST<ANY> values (duplicates included).

Function

apoc.coll.zip(list1 LIST<ANY>, list2 LIST<ANY>) - returns the two given LIST<ANY> values zipped together as a LIST<LIST<ANY>>.

Function

apoc.convert

Qualified Name Type

apoc.convert.setJsonProperty(node NODE, key STRING, value ANY) - serializes the given JSON object and sets it as a property on the given NODE.

Procedure

apoc.convert.toTree(paths LIST<PATH>, lowerCaseRels BOOLEAN, config MAP<STRING, ANY>) - returns a stream of MAP values, representing the given PATH values as a tree with at least one root.

Procedure

apoc.convert.fromJsonList(list LIST<STRING>, path STRING, pathOptions LIST<STRING>) - converts the given JSON list into a Cypher LIST<STRING>.

Function

apoc.convert.fromJsonMap(map STRING, path STRING, pathOptions LIST<STRING>) - converts the given JSON map into a Cypher MAP.

Function

apoc.convert.getJsonProperty(node NODE, key STRING, path STRING, pathOptions LIST<STRING>) - converts a serialized JSON object from the property of the given NODE into the equivalent Cypher structure (e.g. MAP, LIST<ANY>).

Function

apoc.convert.getJsonPropertyMap(node NODE, key STRING, path STRING, pathOptions LIST<STRING>) - converts a serialized JSON object from the property of the given NODE into a Cypher MAP.

Function

apoc.convert.toJson(value ANY) - serializes the given JSON value.

Function

apoc.convert.toList(value ANY) - converts the given value into a LIST<ANY>.

Function

apoc.convert.toMap(map ANY) - converts the given value into a MAP.

Function

apoc.convert.toNode(node ANY) - converts the given value into a NODE.

Function

apoc.convert.toNodeList(list LIST<ANY>) - converts the given value into a LIST<NODE>.

Function

apoc.convert.toRelationship(rel ANY) - converts the given value into a RELATIONSHIP.

Function

apoc.convert.toRelationshipList(relList LIST<ANY>) - converts the given value into a LIST<RELATIONSHIP>.

Function

apoc.convert.toSet(list LIST<ANY>) - converts the given value into a set represented in Cypher as a LIST<ANY>.

Function

apoc.convert.toSortedJsonMap(value ANY, ignoreCase BOOLEAN) - converts a serialized JSON object from the property of a given NODE into a Cypher MAP.

Function

apoc.create

Qualified Name Type

apoc.create.addLabels(nodes ANY, labels LIST<STRING>) - adds the given labels to the given NODE values.

Procedure

apoc.create.clonePathToVirtual(path PATH) - takes the given PATH and returns a virtual representation of it.

Procedure

apoc.create.clonePathsToVirtual(paths LIST<PATH>) - takes the given LIST<PATH> and returns a virtual representation of them.

Procedure

apoc.create.node(labels LIST<STRING>, props MAP<STRING, ANY>) - creates a NODE with the given dynamic labels.

Procedure

apoc.create.nodes(labels LIST<STRING>, props LIST<MAP<STRING, ANY>>) - creates NODE values with the given dynamic labels.

Procedure

apoc.create.relationship(from NODE, relType STRING, props MAP<STRING, ANY>, to NODE) - creates a RELATIONSHIP with the given dynamic relationship type.

Procedure

apoc.create.removeLabels(nodes ANY, labels LIST<STRING>) - removes the given labels from the given NODE values.

Procedure

apoc.create.removeProperties(nodes ANY, keys LIST<STRING>) - removes the given properties from the given NODE values.

Procedure

apoc.create.removeRelProperties(rels ANY, keys LIST<STRING>) - removes the given properties from the given RELATIONSHIP values.

Procedure

apoc.create.setLabels(nodes ANY, labels LIST<STRING>) - sets the given labels to the given NODE values. Non-matching labels are removed from the nodes.

Procedure

apoc.create.setProperties(nodes ANY, keys LIST<STRING>, values LIST<ANY>) - sets the given properties to the given NODE values.

Procedure

apoc.create.setProperty(nodes ANY, key STRING, value ANY) - sets the given property to the given NODE values.

Procedure

apoc.create.setRelProperties(rels ANY, keys LIST<STRING>, values LIST<ANY>) - sets the given properties on the RELATIONSHIP values.

Procedure

apoc.create.setRelProperty(rels ANY, key STRING, value ANY) - sets the given property on the RELATIONSHIP values.

Procedure

apoc.create.uuids(count INTEGER) - returns a stream of UUIDs.

Procedure Deprecated

apoc.create.vNode(labels LIST<STRING>, props MAP<STRING, ANY>) - returns a virtual NODE.

Procedure

apoc.create.vNodes(labels LIST<STRING>, props LIST<MAP<STRING, ANY>>) - returns virtual NODE values.

Procedure

apoc.create.vRelationship(from NODE, relType STRING, props MAP<STRING, ANY>, to NODE) - returns a virtual RELATIONSHIP.

Procedure

apoc.create.virtualPath(labelsN LIST<STRING>,n MAP<STRING, ANY>, relType STRING, props MAP<STRING, ANY>, labelsM LIST<STRING>, m MAP<STRING, ANY>) - returns a virtual PATH.

Procedure

apoc.create.uuid() - returns a UUID.

Function Deprecated

apoc.create.uuidBase64() - returns a UUID encoded with base64.

Function

apoc.create.uuidBase64ToHex(base64Uuid STRING) - takes the given base64 encoded UUID and returns it as a hexadecimal STRING.

Function

apoc.create.uuidHexToBase64(uuid STRING) - takes the given UUID represented as a hexadecimal STRING and returns it encoded with base64.

Function

apoc.create.virtual.fromNode(node NODE, propertyNames LIST<STRING>) - returns a virtual NODE from the given existing NODE. The virtual NODE only contains the requested properties.

Function

apoc.create.vNode(labels LIST<STRING>, props MAP<STRING, ANY>) - returns a virtual NODE.

Function

apoc.create.vRelationship(from NODE, relType STRING, props MAP<STRING, ANY>, to NODE) - returns a virtual RELATIONSHIP.

Function

apoc.cypher

Qualified Name Type

apoc.cypher.doIt(statement STRING, params MAP<STRING, ANY>) - runs a dynamically constructed statement with the given parameters. This procedure allows for both read and write statements.

Procedure

apoc.cypher.run(statement STRING, params MAP<STRING, ANY>) - runs a dynamically constructed read-only statement with the given parameters.

Procedure

apoc.cypher.runMany(statement STRING, params MAP<STRING, ANY>, config MAP<STRING, ANY>) - runs each semicolon separated statement and returns a summary of the statement outcomes.

Procedure

apoc.cypher.runManyReadOnly(statement STRING, params MAP<STRING, ANY>, config MAP<STRING, ANY>) - runs each semicolon separated read-only statement and returns a summary of the statement outcomes.

Procedure

apoc.cypher.runSchema(statement STRING, params MAP<STRING, ANY>) - runs the given query schema statement with the given parameters.

Procedure

apoc.cypher.runTimeboxed(statement STRING, params MAP<STRING, ANY>, timeout INTEGER) - terminates a Cypher statement if it has not finished before the set timeout (ms).

Procedure

apoc.cypher.runWrite(statement STRING, params MAP<STRING, ANY>) - alias for apoc.cypher.doIt.

Procedure

apoc.cypher.runFirstColumnMany(statement STRING, params MAP<STRING, ANY>) - runs the given statement with the given parameters and returns the first column collected into a LIST<ANY>.

Function

apoc.cypher.runFirstColumnSingle(statement STRING, params MAP<STRING, ANY>) - runs the given statement with the given parameters and returns the first element of the first column.

Function

apoc.data

Qualified Name Type

apoc.data.url(url STRING) - turns a URL into a MAP.

Function

apoc.date

Qualified Name Type

apoc.date.add(time INTEGER, unit STRING, addValue INTEGER, addUnit STRING) - adds a unit of specified time to the given timestamp.

Function

apoc.date.convert(time INTEGER, unit STRING, toUnit STRING) - converts the given timestamp from one time unit into a timestamp of a different time unit.

Function

apoc.date.convertFormat(temporal STRING, currentFormat STRING, convertTo STRING) - converts a STRING of one type of date format into a STRING of another type of date format.

Function

apoc.date.currentTimestamp() - returns the current Unix epoch timestamp in milliseconds.

Function

apoc.date.field(time INTEGER, unit STRING, timezone STRING) - returns the value of one field from the given date time.

Function

apoc.date.fields(date STRING, pattern STRING) - splits the given date into fields returning a MAP containing the values of each field.

Function

apoc.date.format(time INTEGER, unit STRING, format STRING, timezone STRING) - returns a STRING representation of the time value. The time unit (default: ms), date format (default: ISO), and time zone (default: current time zone) can all be changed.

Function

apoc.date.fromISO8601(time STRING) - converts the given date STRING (ISO8601) to an INTEGER representing the time value in milliseconds.

Function

apoc.date.parse(time STRING, unit STRING, format STRING, timezone STRING) - parses the given date STRING from a specified format into the specified time unit.

Function

apoc.date.systemTimezone() - returns the display name of the system time zone (e.g. Europe/London).

Function

apoc.date.toISO8601(time INTEGER, unit STRING) - returns a STRING representation of a specified time value in the ISO8601 format.

Function

apoc.date.toYears(value ANY, format STRING) - converts the given timestamp or the given date into a FLOAT representing years.

Function

apoc.diff

Qualified Name Type

apoc.diff.nodes(leftNode NODE, rightNode NODE) - returns a MAP detailing the differences between the two given NODE values.

Function

apoc.do

Qualified Name Type

apoc.do.case(conditionals LIST<ANY>, elseQuery STRING, params MAP<STRING, ANY>) - for each pair of conditional queries in the given LIST<ANY>, this procedure will run the first query for which the conditional is evaluated to true. If none of the conditionals are true, the ELSE query will run instead.

Procedure

apoc.do.when(condition BOOLEAN, ifQuery STRING, elseQuery STRING, params MAP<STRING, ANY>) - runs the given read/write ifQuery if the conditional has evaluated to true, otherwise the elseQuery will run.

Procedure

apoc.example

Qualified Name Type

apoc.example.movies()- seeds the database with the Neo4j movie dataset.

Procedure

apoc.export

Qualified Name Type

apoc.export.arrow.all(file STRING, config MAP<STRING, ANY>) - exports the full database as an arrow file.

Procedure

apoc.export.arrow.graph(file STRING, graph ANY, config MAP<STRING, ANY>) - exports the given graph as an arrow file.

Procedure

apoc.export.arrow.query(file STRING, query STRING, config MAP<STRING, ANY>) - exports the results from the given Cypher query as an arrow file.

Procedure

apoc.export.arrow.stream.all(config MAP<STRING, ANY>) - exports the full database as an arrow byte array.

Procedure

apoc.export.arrow.stream.graph(graph ANY, config MAP<STRING, ANY>) - exports the given graph as an arrow byte array.

Procedure

apoc.export.arrow.stream.query(query STRING, config MAP<STRING, ANY>) - exports the given Cypher query as an arrow byte array.

Procedure

apoc.export.csv.all(file STRING, config MAP<STRING, ANY>) - exports the full database to the provided CSV file.

Procedure

apoc.export.csv.data(nodes LIST<NODE>, rels LIST<RELATIONSHIP>, file STRING, config MAP<STRING, ANY>) - exports the given NODE and RELATIONSHIP values to the provided CSV file.

Procedure

apoc.export.csv.graph(graph MAP<STRING, ANY>, file STRING, config MAP<STRING, ANY>) - exports the given graph to the provided CSV file.

Procedure

apoc.export.csv.query(query STRING, file STRING, config MAP<STRING, ANY>) - exports the results from running the given Cypher query to the provided CSV file.

Procedure

apoc.export.cypher.all(file STRING, config MAP<STRING, ANY>) - exports the full database (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.data(nodes LIST<NODE>, rels LIST<RELATIONSHIP>, file STRING, config MAP<STRING, ANY>) - exports the given NODE and RELATIONSHIP values (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.graph(graph MAP<STRING, ANY>, file STRING, config MAP<STRING, ANY>) - exports the given graph (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.query(statement STRING, file STRING, config MAP<STRING, ANY>) - exports the NODE and RELATIONSHIP values from the given Cypher query (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.schema(file STRING, config MAP<STRING, ANY>) - exports all schema indexes and constraints to Cypher statements.

Procedure

apoc.export.graphml.all(file STRING, config MAP<STRING, ANY>) - exports the full database to the provided GraphML file.

Procedure

apoc.export.graphml.data(nodes LIST<NODE>, rels LIST<RELATIONSHIP>, file STRING, config MAP<STRING, ANY>) - exports the given NODE and RELATIONSHIP values to the provided GraphML file.

Procedure

apoc.export.graphml.graph(graph MAP<STRING, ANY>, file STRING, config MAP<STRING, ANY>) - exports the given graph to the provided GraphML file.

Procedure

apoc.export.graphml.query(statement STRING, file STRING, config MAP<STRING, ANY>) - exports the given NODE and RELATIONSHIP values from the Cypher statement to the provided GraphML file.

Procedure

apoc.export.json.all(file STRING, config MAP<STRING, ANY>) - exports the full database to the provided JSON file.

Procedure

apoc.export.json.data(nodes LIST<NODE>, rels LIST<RELATIONSHIP>, file STRING, config MAP<STRING, ANY>) - exports the given NODE and RELATIONSHIP values to the provided JSON file.

Procedure

apoc.export.json.graph(graph MAP<STRING, ANY>, file STRING , config MAP<STRING, ANY>) - exports the given graph to the provided JSON file.

Procedure

apoc.export.json.query(statement STRING, file STRING, config MAP<STRING, ANY>) - exports the results from the Cypher statement to the provided JSON file.

Procedure

apoc.graph

Qualified Name Type

apoc.graph.from(data ANY, name STRING, props MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the given data.

Procedure

apoc.graph.fromCypher(statement STRING, params MAP<STRING, ANY>, name STRING, props MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the data returned by the given Cypher statement.

Procedure

apoc.graph.fromData(nodes LIST<NODE>, rels LIST<RELATIONSHIP>, name STRING, props MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the given data.

Procedure

apoc.graph.fromDB(name STRING, props MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the data returned by the given database.

Procedure

apoc.graph.fromDocument(json ANY, config MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the data returned by the given JSON file.

Procedure

apoc.graph.fromPath(path PATH, name STRING, props MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the data returned by the given PATH.

Procedure

apoc.graph.fromPaths(paths LIST<PATH>, name STRING, props MAP<STRING, ANY>) - generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the data returned by the given PATH values.

Procedure

apoc.graph.validateDocument(json ANY, config MAP<STRING, ANY>) - validates the JSON file and returns the result of the validation.

Procedure

apoc.hashing

Qualified Name Type

apoc.hashing.fingerprint(object ANY, excludedPropertyKeys LIST<STRING>) - calculates a MD5 checksum over a NODE or RELATIONSHIP (identical entities share the same checksum). Unsuitable for cryptographic use-cases.

Function

apoc.hashing.fingerprinting(object ANY, config MAP<STRING, ANY>) - calculates a MD5 checksum over a NODE or RELATIONSHIP (identical entities share the same checksum). Unlike apoc.hashing.fingerprint(), this function supports a number of config parameters. Unsuitable for cryptographic use-cases.

Function

apoc.hashing.fingerprintGraph(propertyExcludes LIST<STRING>) - calculates a MD5 checksum over the full graph. This function uses in-memory data structures. Unsuitable for cryptographic use-cases.

Function

apoc.import

Qualified Name Type

apoc.import.csv(nodes LIST<MAP<STRING, ANY>>, rels LIST<MAP<STRING, ANY>>, config MAP<STRING, ANY>) - imports NODE and RELATIONSHIP values with the given labels and types from the provided CSV file.

Procedure

apoc.import.graphml(urlOrBinaryFile ANY, config MAP<STRING, ANY>) - imports a graph from the provided GraphML file.

Procedure

apoc.import.json(urlOrBinaryFile ANY, config MAP<STRING, ANY>) - imports a graph from the provided JSON file.

Procedure

apoc.import.xml(urlOrBinary ANY, config MAP<STRING, ANY>) - imports a graph from the provided XML file.

Procedure

apoc.json

Qualified Name Type

apoc.json.path(json STRING, path STRING, pathOptions LIST<STRING>) - returns the given JSON path.

Function

apoc.label

Qualified Name Type

apoc.label.exists(node ANY, label STRING) - returns true or false depending on whether or not the given label exists.

Function

apoc.load

Qualified Name Type

apoc.load.arrow(file STRING, config MAP<STRING, ANY>) - imports NODE and RELATIONSHIP values from the provided arrow file.

Procedure

apoc.load.arrow.stream(source LIST<INTEGER>, config MAP<STRING, ANY>) - imports NODE and RELATIONSHIP values from the provided arrow byte array.

Procedure

apoc.load.json(urlOrKeyOrBinary ANY, path STRING, config MAP<STRING, ANY>) - imports JSON file as a stream of values if the given JSON file is a LIST<ANY>. If the given JSON file is a MAP, this procedure imports a single value instead.

Procedure

apoc.load.jsonArray(url STRING, path STRING, config MAP<STRING, ANY>) - loads array from a JSON URL (e.g. web-API) to then import the given JSON file as a stream of values.

Procedure

apoc.load.jsonParams(urlOrKeyOrBinary ANY, headers MAP<STRING, ANY>, payload STRING, path STRING, config MAP<STRING, ANY>) - loads parameters from a JSON URL (e.g. web-API) as a stream of values if the given JSON file is a LIST<ANY>. If the given JSON file is a MAP, this procedure imports a single value instead.

Procedure

apoc.load.xml(urlOrBinary ANY, path STRING, config MAP<STRING, ANY>, simple BOOLEAN) - loads a single nested MAP from an XML URL (e.g. web-API).

Procedure

apoc.lock

Qualified Name Type

apoc.lock.all(nodes LIST<NODE>, rels LIST<RELATIONSHIP>) - acquires a write lock on the given NODE and RELATIONSHIP values.

Procedure

apoc.lock.nodes(nodes LIST<NODE>) - acquires a write lock on the given NODE values.

Procedure

apoc.lock.read.nodes(nodes LIST<NODE>) - acquires a read lock on the given NODE values.

Procedure

apoc.lock.read.rels(rels LIST<RELATIONSHIP>) - acquires a read lock on the given RELATIONSHIP values.

Procedure

apoc.lock.rels(rels LIST<RELATIONSHIP>) - acquires a write lock on the given RELATIONSHIP values.

Procedure

apoc.log

Qualified Name Type

apoc.log.stream(path STRING, config MAP<STRING, ANY>) - returns the file contents from the given log, optionally returning only the last n lines. This procedure requires users to have an admin role.

Procedure

apoc.map

Qualified Name Type

apoc.map.clean(map MAP<STRING, ANY>, keys LIST<STRING>, values LIST<ANY>) - filters the keys and values contained in the given LIST<ANY> values.

Function

apoc.map.flatten(map MAP<STRING, ANY>, delimiter STRING) - flattens nested items in the given MAP. This function is the reverse of the apoc.map.unflatten function.

Function

apoc.map.fromLists(keys LIST<STRING>, values LIST<ANY>) - creates a MAP from the keys and values in the given LIST<ANY> values.

Function

apoc.map.fromNodes(label STRING, prop STRING) - returns a MAP of the given prop to the node of the given label.

Function

apoc.map.fromPairs(pairs LIST<LIST<key ANY, value ANY>>) - creates a MAP from the given LIST<LIST<ANY>> of key-value pairs.

Function

apoc.map.fromValues(values LIST<ANY>) - creates a MAP from the alternating keys and values in the given LIST<ANY>.

Function

apoc.map.get(map MAP<STRING, ANY>, key STRING, value ANY, fail BOOLEAN) - returns a value for the given key. If the given key does not exist, or lacks a default value, this function will throw an exception.

Function

apoc.map.groupBy(values LIST<ANY>, key STRING) - creates a MAP of the LIST<ANY> keyed by the given property, with single values.

Function

apoc.map.groupByMulti(values LIST<ANY>, key STRING) - creates a MAP of the LIST<ANY> values keyed by the given property, with the LIST<ANY> values.

Function

apoc.map.merge(map1 MAP<STRING, ANY>, map2 MAP<STRING, ANY>) - merges the two given MAP values into one MAP.

Function

apoc.map.mergeList(maps LIST<MAP<STRING, Value>>) - merges all MAP values in the given LIST<MAP<STRING, ANY>> into one MAP.

Function

apoc.map.mget(map MAP<STRING, ANY>, keys LIST<STRING>, values LIST<ANY>, fail BOOLEAN) - returns a LIST<ANY> for the given keys. If one of the keys does not exist, or lacks a default value, this function will throw an exception.

Function

apoc.map.removeKey(map MAP<STRING, ANY>, key STRING, config MAP<STRING, ANY>) - removes the given key from the MAP (recursively if recursive is true).

Function

apoc.map.removeKeys(map MAP<STRING, ANY>, keys LIST<STRING>, config MAP<STRING, ANY>) - removes the given keys from the MAP (recursively if recursive is true).

Function

apoc.map.setEntry(map MAP<STRING, ANY>, key STRING, value ANY) - adds or updates the given entry in the MAP.

Function

apoc.map.setKey(map MAP<STRING, ANY>, key STRING, value ANY) - adds or updates the given entry in the MAP.

Function

apoc.map.setLists(map MAP<STRING, ANY>, keys LIST<STRING>, values LIST<ANY>) - adds or updates the given keys/value pairs provided in LIST<ANY> format (e.g. [key1, key2],[value1, value2]) in a MAP.

Function

apoc.map.setPairs(map MAP<STRING, ANY>, pairs LIST<LIST<key ANY, value ANY>>) - adds or updates the given key/value pairs (e.g. [key1,value1],[key2,value2]) in a MAP.

Function

apoc.map.setValues(map MAP<STRING, ANY>, pairs LIST<key ANY, value ANY>) - adds or updates the alternating key/value pairs (e.g. [key1,value1,key2,value2]) in a MAP.

Function

apoc.map.sortedProperties(map MAP<STRING, ANY>, ignoreCase BOOLEAN) - returns a LIST<ANY> of key/value pairs. The pairs are sorted by alphabetically by key, with optional case sensitivity.

Function

apoc.map.submap(map MAP<STRING, ANY>, keys LIST<STRING>, values LIST<ANY>, fail BOOLEAN) - returns a sub-map for the given keys. If one of the keys does not exist, or lacks a default value, this function will throw an exception.

Function

apoc.map.unflatten(map MAP<STRING, ANY>, delimiter STRING) - unflattens items in the given MAP to nested items. This function is the reverse of the apoc.map.flatten function.

Function

apoc.map.updateTree(tree MAP<STRING, ANY>, key STRING, data LIST<LIST<key ANY, value ANY>>)- adds the data MAP on each level of the nested tree, where the key-value pairs match.

Function

apoc.map.values(map MAP<STRING, ANY>, keys LIST<STRING>, addNullsForMissing BOOLEAN) - returns a LIST<ANY> indicated by the given keys (returns a null value if a given key is missing).

Function

apoc.math

Qualified Name Type

apoc.math.regr(label STRING, propertyY STRING, propertyX STRING) - returns the coefficient of determination (R-squared) for the values of propertyY and propertyX in the given label.

Procedure

apoc.math.cosh(value FLOAT) - returns the hyperbolic cosine.

Function

apoc.math.coth(value FLOAT) - returns the hyperbolic cotangent.

Function

apoc.math.csch(value FLOAT) - returns the hyperbolic cosecant.

Function

apoc.math.maxByte() - returns the maximum value of a byte.

Function

apoc.math.maxDouble() - returns the largest positive finite value of type double.

Function

apoc.math.maxInt() - returns the maximum value of an integer.

Function

apoc.math.maxLong() - returns the maximum value of a long.

Function

apoc.math.minByte() - returns the minimum value of a byte.

Function

apoc.math.minDouble() - returns the smallest positive non-zero value of type double.

Function

apoc.math.minInt() - returns the minimum value of an integer.

Function

apoc.math.minLong() - returns the minimum value of a long.

Function

apoc.math.sech(value FLOAT) - returns the hyperbolic secant of the given value.

Function

apoc.math.sigmoid(value FLOAT) - returns the sigmoid of the given value.

Function

apoc.math.sigmoidPrime(value FLOAT) - returns the sigmoid prime [ sigmoid(val) * (1 - sigmoid(val)) ] of the given value.

Function

apoc.math.sinh(value FLOAT) - returns the hyperbolic sine of the given value.

Function

apoc.math.tanh(value FLOAT) - returns the hyperbolic tangent of the given value.

Function

apoc.merge

Qualified Name Type

apoc.merge.node(labels LIST<STRING>, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, onMatchProps MAP<STRING, ANY>) - merges the given NODE values with the given dynamic labels.

Procedure

apoc.merge.node.eager(labels LIST<STRING>, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, onMatchProps MAP<STRING, ANY>) - merges the given NODE values with the given dynamic labels eagerly.

Procedure

apoc.merge.nodeWithStats(labels LIST<STRING>, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, onMatchProps MAP<STRING, ANY>) - merges the given NODE values with the given dynamic labels. Provides queryStatistics in the result.

Procedure

apoc.merge.nodeWithStats.eager(labels LIST<STRING>, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, onMatchProps MAP<STRING, ANY>) - merges the given NODE values with the given dynamic labels eagerly. Provides queryStatistics in the result.

Procedure

apoc.merge.relationship(startNode NODE, relType STRING, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, endNode NODE, onMatchProps MAP<STRING, ANY>) - merges the given RELATIONSHIP values with the given dynamic types/properties.

Procedure

apoc.merge.relationship.eager(startNode NODE, relType STRING, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, endNode NODE, onMatchProps MAP<STRING, ANY>) - merges the given RELATIONSHIP values with the given dynamic types/properties eagerly.

Procedure

apoc.merge.relationshipWithStats(startNode NODE, relType STRING, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, endNode NODE, onMatchProps MAP<STRING, ANY>) - merges the given RELATIONSHIP values with the given dynamic types/properties. Provides queryStatistics in the result.

Procedure

apoc.merge.relationshipWithStats.eager(startNode NODE, relType STRING, identProps MAP<STRING, ANY>, onCreateProps MAP<STRING, ANY>, endNode NODE, onMatchProps MAP<STRING, ANY>) - merges the given RELATIONSHIP values with the given dynamic types/properties eagerly. Provides queryStatistics in the result.

Procedure

apoc.meta

Qualified Name Type

apoc.meta.data(config MAP<STRING, ANY>) - examines the full graph and returns a table of metadata.

Procedure

apoc.meta.data.of(graph ANY, config MAP<STRING, ANY>) - examines the given sub-graph and returns a table of metadata.

Procedure

apoc.meta.graph(config MAP<STRING, ANY>) - examines the full graph and returns a meta-graph.

Procedure

apoc.meta.graph.of(graph ANY, config MAP<STRING, ANY>) - examines the given sub-graph and returns a meta-graph.

Procedure

apoc.meta.graphSample(config MAP<STRING, ANY>) - examines the full graph and returns a meta-graph. Unlike apoc.meta.graph, this procedure does not filter away non-existing paths.

Procedure

apoc.meta.nodeTypeProperties(config MAP<STRING, ANY>) - examines the full graph and returns a table of metadata with information about the NODE values therein.

Procedure

apoc.meta.relTypeProperties(config MAP<STRING, ANY>) - examines the full graph and returns a table of metadata with information about the RELATIONSHIP values therein.

Procedure

apoc.meta.schema(config MAP<STRING, ANY>) - examines the given sub-graph and returns metadata as a MAP.

Procedure

apoc.meta.stats() - returns the metadata stored in the transactional database statistics.

Procedure

apoc.meta.subGraph(config MAP<STRING, ANY>) - examines the given sub-graph and returns a meta-graph.

Procedure

apoc.meta.cypher.isType(value ANY, type STRING) - returns true if the given value matches the given type.

Function

apoc.meta.cypher.type(value ANY) - returns the type name of the given value.

Function

apoc.meta.cypher.types(props ANY) - returns a MAP containing the type names of the given values.

Function

apoc.meta.nodes.count(nodes LIST<STRING>, config MAP<STRING, ANY>) - returns the sum of the NODE values with the given labels in the LIST<STRING>.

Function

apoc.neighbors

Qualified Name Type

apoc.neighbors.athop(node NODE, relTypes STRING, distance INTEGER) - returns all NODE values connected by the given RELATIONSHIP types at the specified distance.

Procedure

apoc.neighbors.athop.count(node NODE, relTypes STRING, distance INTEGER) - returns the count of all NODE values connected by the given RELATIONSHIP types at the specified distance.

Procedure

apoc.neighbors.byhop(node NODE, relTypes STRING, distance INTEGER) - returns all NODE values connected by the given RELATIONSHIP types within the specified distance. Returns LIST<NODE> values, where each PATH of NODE values represents one row of the LIST<NODE> values.

Procedure

apoc.neighbors.byhop.count(node NODE, relTypes STRING, distance INTEGER) - returns the count of all NODE values connected by the given RELATIONSHIP types within the specified distance.

Procedure

apoc.neighbors.tohop(node NODE, relTypes STRING, distance INTEGER) - returns all NODE values connected by the given RELATIONSHIP types within the specified distance. NODE values are returned individually for each row.

Procedure

apoc.neighbors.tohop.count(node NODE, relTypes STRING, distance INTEGER) - returns the count of all NODE values connected by the given RELATIONSHIP values in the pattern within the specified distance.

Procedure

apoc.node

Qualified Name Type

apoc.node.degree(node NODE, relTypes STRING) - returns the total degrees of the given NODE.

Function

apoc.node.degree.in(node NODE, relTypes STRING) - returns the total number of incoming RELATIONSHIP values connected to the given NODE.

Function

apoc.node.degree.out(node NODE, relTypes STRING) - returns the total number of outgoing RELATIONSHIP values from the given NODE.

Function

apoc.node.id(node NODE) - returns the id for the given virtual NODE.

Function

apoc.node.labels(node NODE) - returns the labels for the given virtual NODE.

Function

apoc.node.relationship.exists(node NODE, relTypes STRING) - returns a BOOLEAN based on whether the given NODE has a connecting RELATIONSHIP (or whether the given NODE has a connecting RELATIONSHIP of the given type and direction).

Function

apoc.node.relationship.types(node NODE, relTypes STRING) - returns a LIST<STRING> of distinct RELATIONSHIP types for the given NODE.

Function

apoc.node.relationships.exist(node NODE, relTypes STRING) - returns a BOOLEAN based on whether the given NODE has connecting RELATIONSHIP values (or whether the given NODE has connecting RELATIONSHIP values of the given type and direction).

Function

apoc.nodes

Qualified Name Type

apoc.nodes.collapse(nodes LIST<NODE>, config MAP<STRING, ANY>) - merges NODE values together in the given LIST<NODE>. The NODE values are then combined to become one NODE, with all labels of the previous NODE values attached to it, and all RELATIONSHIP values pointing to it.

Procedure

apoc.nodes.cycles(nodes LIST<NODE>, config MAP<STRING, ANY>) - detects all PATH cycles in the given LIST<NODE>. This procedure can be limited on RELATIONSHIP values as well.

Procedure

apoc.nodes.delete(nodes ANY, batchSize INTEGER) - deletes all NODE values with the given ids.

Procedure

apoc.nodes.get(nodes ANY) - returns all NODE values with the given ids.

Procedure

apoc.nodes.group(labels LIST<STRING>, groupByProperties LIST<STRING>, aggregations LIST<MAP<STRING, ANY>>, config MAP<STRING, ANY>) - allows for the aggregation of NODE values based on the given properties. This procedure returns virtual NODE values.

Procedure

apoc.nodes.link(nodes LIST<NODE>, type STRING, config MAP<STRING, ANY>) - creates a linked list of the given NODE values connected by the given RELATIONSHIP type.

Procedure

apoc.nodes.rels(rels ANY) - returns all RELATIONSHIP values with the given ids.

Procedure

apoc.nodes.connected(startNode NODE, endNode NODE, types STRING) - returns true when a given NODE is directly connected to another given NODE. This function is optimized for dense nodes.

Function

apoc.nodes.isDense(node NODE) - returns true if the given NODE is a dense node.

Function

apoc.nodes.relationship.types(nodes ANY, types STRING) - returns a LIST<STRING> of distinct RELATIONSHIP types from the given LIST<NODE> values.

Function

apoc.nodes.relationships.exist(nodes ANY, types STRING) - returns a BOOLEAN based on whether or not the given NODE values have the given RELATIONSHIP values.

Function

apoc.number

Qualified Name Type

apoc.number.arabicToRoman(number ANY) - converts the given Arabic numbers to Roman numbers.

Function

apoc.number.exact.add(stringA STRING, stringB STRING) - returns the result of adding the two given large numbers (using Java BigDecimal).

Function

apoc.number.exact.div(stringA STRING, stringB STRING, precision INTEGER, roundingMode STRING) - returns the result of dividing a given large number with another given large number (using Java BigDecimal).

Function

apoc.number.exact.mul(stringA STRING, stringB STRING, precision INTEGER, roundingMode STRING) - returns the result of multiplying two given large numbers (using Java BigDecimal).

Function

apoc.number.exact.sub(stringA STRING, stringB STRING) - returns the result of subtracting a given large number from another given large number (using Java BigDecimal).

Function

apoc.number.exact.toExact(number INTEGER) - returns the exact value of the given number (using Java BigDecimal).

Function

apoc.number.exact.toFloat(string STRING, precision INTEGER, roundingMode STRING) - returns the FLOAT of the given large number (using Java BigDecimal).

Function

apoc.number.exact.toInteger(string STRING, precision INTEGER, roundingMode STRING) - returns the INTEGER of the given large number (using Java BigDecimal).

Function

apoc.number.format(number ANY, pattern STRING, language STRING) - formats the given INTEGER or FLOAT using the given pattern and language to produce a STRING.

Function

apoc.number.parseFloat(text STRING, pattern STRING, language STRING) - parses the given STRING using the given pattern and language to produce a FLOAT.

Function

apoc.number.parseInt(text STRING, pattern STRING, language STRING) - parses the given STRING using the given pattern and language to produce a INTEGER.

Function

apoc.number.romanToArabic(romanNumber STRING) - converts the given Roman numbers to Arabic numbers.

Function

apoc.path

Qualified Name Type

apoc.path.expand(startNode ANY, relFilter STRING, labelFilter STRING, minDepth INTEGER, maxDepth INTEGER) - returns PATH values expanded from the start NODE following the given RELATIONSHIP types from min-depth to max-depth.

Procedure

apoc.path.expandConfig(startNode ANY, config MAP<STRING, ANY>) - returns PATH values expanded from the start NODE with the given RELATIONSHIP types from min-depth to max-depth.

Procedure

apoc.path.spanningTree(startNode ANY, config MAP<STRING, ANY>) - returns spanning tree PATH values expanded from the start NODE following the given RELATIONSHIP types to max-depth.

Procedure

apoc.path.subgraphAll(startNode ANY, config MAP<STRING, ANY>) - returns the sub-graph reachable from the start NODE following the given RELATIONSHIP types to max-depth.

Procedure

apoc.path.subgraphNodes(startNode ANY, config MAP<STRING, ANY>) - returns the NODE values in the sub-graph reachable from the start NODE following the given RELATIONSHIP types to max-depth.

Procedure

apoc.path.combine(path1 PATH, path2 PATH) - combines the two given PATH values into one PATH.

Function

apoc.path.create(startNode NODE, rels LIST<RELATIONSHIP>) - returns a PATH from the given start NODE and LIST<RELATIONSHIP>.

Function

apoc.path.elements(path PATH) - converts the given PATH into a LIST<NODE | RELATIONSHIP>.

Function

apoc.path.slice(path PATH, offset INTEGER, length INTEGER) - returns a new PATH of the given length, taken from the given PATH at the given offset.

Function

apoc.periodic

Qualified Name Type

apoc.periodic.cancel(name STRING) - cancels the given background job. Background jobs are created using apoc.periodic.submit.

Procedure

apoc.periodic.commit(statement STRING, params MAP<STRING, ANY>) - runs the given statement in separate batched transactions.

Procedure

apoc.periodic.countdown(name STRING, statement STRING, delay INTEGER) - runs a repeatedly called background statement until it returns 0.

Procedure

apoc.periodic.iterate(cypherIterate STRING, cypherAction STRING, config MAP<STRING, ANY>) - runs the second statement for each item returned by the first statement. This procedure returns the number of batches and the total number of processed rows.

Procedure

apoc.periodic.list() - returns a LIST<ANY> of all background jobs.

Procedure

apoc.periodic.repeat(name STRING, statement STRING, rate INTEGER, config MAP<STRING, ANY>) - runs a repeatedly called background job. To stop this procedure, use apoc.periodic.cancel.

Procedure

apoc.periodic.submit(name STRING, statement STRING, params MAP<STRING, ANY>) - creates a background job which runs the given Cypher statement once.

Procedure

apoc.periodic.truncate(config MAP<STRING, ANY>) - removes all entities (and optionally indexes and constraints) from the database using the apoc.periodic.iterate procedure.

Procedure

apoc.refactor

Qualified Name Type

apoc.refactor.categorize(sourceKey STRING, type STRING, outgoing BOOLEAN, label STRING, targetKey STRING, copiedKeys LIST<STRING>, batchSize INTEGER) - creates new category NODE values from NODE values in the graph with the specified sourceKey as one of its property keys. The new category NODE values are then connected to the original NODE values with a RELATIONSHIP of the given type.

Procedure

apoc.refactor.cloneNodes(nodes LIST<NODE>, withRelationships BOOLEAN, skipProperties LIST<STRING>) - clones the given NODE values with their labels and properties. It is possible to skip any NODE properties using skipProperties (note: this only skips properties on NODE values and not their RELATIONSHIP values).

Procedure

apoc.refactor.cloneSubgraph(nodes LIST<NODE>, rels LIST<RELATIONSHIP>, config MAP<STRING, ANY>) - clones the given NODE values with their labels and properties (optionally skipping any properties in the skipProperties LIST<STRING> via the config MAP), and clones the given RELATIONSHIP values. If no RELATIONSHIP values are provided, all existing RELATIONSHIP values between the given NODE values will be cloned.

Procedure

apoc.refactor.cloneSubgraphFromPaths(paths LIST<PATH>, config MAP<STRING, ANY>) - clones a sub-graph defined by the given LIST<PATH> values. It is possible to skip any NODE properties using the skipProperties LIST<STRING> via the config MAP.

Procedure

apoc.refactor.collapseNode(nodes ANY, relType STRING) - collapses the given NODE and replaces it with a RELATIONSHIP of the given type.

Procedure

apoc.refactor.deleteAndReconnect(path PATH, nodes LIST<NODE>, config MAP<STRING, ANY>) - removes the given NODE values from the PATH and reconnects the remaining NODE values.

Procedure

apoc.refactor.extractNode(rels ANY, labels LIST<STRING>, outType STRING, inType STRING) - expands the given RELATIONSHIP VALUES into intermediate NODE VALUES. The intermediate NODE values are connected by the given outType and inType.

Procedure

apoc.refactor.from(rel RELATIONSHIP, newNode NODE) - redirects the given RELATIONSHIP to the given start NODE.

Procedure

apoc.refactor.invert(rel RELATIONSHIP) - inverts the direction of the given RELATIONSHIP.

Procedure

apoc.refactor.mergeNodes(nodes LIST<NODE>, config MAP<STRING, ANY>) - merges the given LIST<NODE> onto the first NODE in the LIST<NODE>. All RELATIONSHIP values are merged onto that NODE as well.

Procedure

apoc.refactor.mergeRelationships(rels LIST<RELATIONSHIP>, config MAP<STRING, ANY>) - merges the given LIST<RELATIONSHIP> onto the first RELATIONSHIP in the LIST<RELATIONSHIP>.

Procedure

apoc.refactor.normalizeAsBoolean(entity ANY, propertyKey STRING, trueValues LIST<ANY>, falseValues LIST<ANY>) - refactors the given property to a BOOLEAN.

Procedure

apoc.refactor.rename.label(oldLabel STRING, newLabel STRING, nodes LIST<NODE>) - renames the given label from oldLabel to newLabel for all NODE values. If a LIST<NODE> is provided, the renaming is applied to the NODE values within this LIST<NODE> only.

Procedure

apoc.refactor.rename.nodeProperty(oldName STRING, newName STRING, nodes LIST<NODE>, config MAP<STRING, ANY>) - renames the given property from oldName to newName for all NODE values. If a LIST<NODE> is provided, the renaming is applied to the NODE values within this LIST<NODE> only.

Procedure

apoc.refactor.rename.type(oldType STRING, newType STRING, rels LIST<RELATIONSHIP>, config MAP<STRING, ANY>) - renames all RELATIONSHIP values with type oldType to newType. If a LIST<RELATIONSHIP> is provided, the renaming is applied to the RELATIONSHIP values within this LIST<RELATIONSHIP> only.

Procedure

apoc.refactor.rename.typeProperty(oldName STRING, newName STRING, rels LIST<RELATIONSHIP>, config MAP<STRING, ANY>) - renames the given property from oldName to newName for all RELATIONSHIP values. If a LIST<RELATIONSHIP> is provided, the renaming is applied to the RELATIONSHIP values within this LIST<RELATIONSHIP> only.

Procedure

apoc.refactor.setType(rel RELATIONSHIP, newType STRING) - changes the type of the given RELATIONSHIP.

Procedure

apoc.refactor.to(rel RELATIONSHIP, endNode NODE) - redirects the given RELATIONSHIP to the given end NODE.

Procedure

apoc.rel

Qualified Name Type

apoc.rel.endNode(rel RELATIONSHIP) - returns the end NODE for the given virtual RELATIONSHIP.

Function

apoc.rel.id(rel RELATIONSHIP) - returns the id for the given virtual RELATIONSHIP.

Function

apoc.rel.startNode(rel RELATIONSHIP) - returns the start NODE for the given virtual RELATIONSHIP.

Function

apoc.rel.type(rel RELATIONSHIP) - returns the type for the given virtual RELATIONSHIP.

Function

apoc.schema

Qualified Name Type

apoc.schema.assert(indexes MAP<STRING, LIST<ANY>>, constraints MAP<STRING, LIST<ANY>>, dropExisting BOOLEAN) - drops all other existing indexes and constraints when dropExisting is true (default is true). Asserts at the end of the operation that the given indexes and unique constraints are there.

Procedure

apoc.schema.nodes(config MAP<STRING, ANY>) - returns all indexes and constraints information for all NODE labels in the database. It is possible to define a set of labels to include or exclude in the config parameters.

Procedure

apoc.schema.properties.distinct(label STRING, key STRING) - returns all distinct NODE property values for the given key.

Procedure

apoc.schema.properties.distinctCount(label STRING, key STRING) - returns all distinct property values and counts for the given key.

Procedure

apoc.schema.relationships(config MAP<STRING, ANY>) - returns the indexes and constraints information for all the relationship types in the database. It is possible to define a set of relationship types to include or exclude in the config parameters.

Procedure

apoc.schema.node.constraintExists(labelName STRING, propertyName LIST<STRING>) - returns a BOOLEAN depending on whether or not a constraint exists for the given NODE label with the given property names.

Function

apoc.schema.node.indexExists(labelName STRING, propertyName LIST<STRING>) - returns a BOOLEAN depending on whether or not an index exists for the given NODE label with the given property names.

Function

apoc.schema.relationship.constraintExists(type STRING, propertyName LIST<STRING>) - returns a BOOLEAN depending on whether or not a constraint exists for the given RELATIONSHIP type with the given property names.

Function

apoc.schema.relationship.indexExists(type STRING, propertyName LIST<STRING>)- returns a BOOLEAN depending on whether or not an index exists for the given RELATIONSHIP type with the given property names.

Function

apoc.scoring

Qualified Name Type

apoc.scoring.existence(score INTEGER, exists BOOLEAN) - returns the given score if true, 0 if false.

Function

apoc.scoring.pareto(minimumThreshold INTEGER, eightyPercentValue INTEGER, maximumValue INTEGER, score INTEGER) - applies a Pareto scoring function over the given INTEGER values.

Function

Qualified Name Type

apoc.search.multiSearchReduced(labelPropertyMap ANY, operator STRING, value STRING) - returns a reduced representation of the NODE values found after a parallel search over multiple indexes. The reduced NODE values representation includes: node id, node labels, and the searched properties.

Procedure

apoc.search.node(labelPropertyMap ANY, operator STRING, value STRING) - returns all the distinct NODE values found after a parallel search over multiple indexes.

Procedure

apoc.search.nodeAll(labelPropertyMap ANY, operator STRING, value STRING) - returns all the NODE values found after a parallel search over multiple indexes.

Procedure

apoc.search.nodeAllReduced(labelPropertyMap ANY, operator STRING, value ANY) - returns a reduced representation of the NODE values found after a parallel search over multiple indexes. The reduced NODE values representation includes: node id, node labels, and the searched properties.

Procedure

apoc.search.nodeReduced(labelPropertyMap ANY, operator STRING, value STRING) - returns a reduced representation of the distinct NODE values found after a parallel search over multiple indexes. The reduced NODE values representation includes: node id, node labels, and the searched properties.

Procedure

apoc.spatial

Qualified Name Type

apoc.spatial.geocode(location STRING, maxResults INTEGER, quotaException BOOLEAN, config MAP<STRING, ANY>)) - returns the geographic location (latitude, longitude, and description) of the given address using a geocoding service (default: OpenStreetMap).

Procedure

apoc.spatial.geocodeOnce(location STRING, config MAP<STRING, ANY>) - returns the geographic location (latitude, longitude, and description) of the given address using a geocoding service (default: OpenStreetMap). This procedure returns at most one result.

Procedure

apoc.spatial.reverseGeocode(latitude FLOAT, longitude FLOAT, quotaException BOOLEAN, config MAP<STRING, ANY>) - returns a textual address from the given geographic location (latitude, longitude) using a geocoding service (default: OpenStreetMap). This procedure returns at most one result.

Procedure

apoc.spatial.sortByDistance(paths LIST<PATH>) - sorts the given collection of PATH values by the sum of their distance based on the latitude/longitude values in the NODE values.

Procedure

apoc.stats

Qualified Name Type

apoc.stats.degrees(relTypes STRING) - returns the percentile groupings of the degrees on the NODE values connected by the given RELATIONSHIP types.

Procedure

apoc.temporal

Qualified Name Type

apoc.temporal.format(temporal ANY, format STRING) - formats the given temporal value into the given time format.

Function

apoc.temporal.formatDuration(input ANY, format STRING) - formats the given duration into the given time format.

Function

apoc.temporal.toZonedTemporal(time STRING, format STRING, timezone STRING) - parses the given date STRING using the specified format into the given time zone.

Function

apoc.text

Qualified Name Type

apoc.text.phoneticDelta(text1 STRING, text2 STRING) - returns the US_ENGLISH soundex character difference between the two given STRING values.

Procedure

apoc.text.base64Decode(text STRING) - decodes the given Base64 encoded STRING.

Function

apoc.text.base64Encode(text STRING) - encodes the given STRING with Base64.

Function

apoc.text.base64UrlDecode(url STRING) - decodes the given Base64 encoded URL.

Function

apoc.text.base64UrlEncode(url STRING) - encodes the given URL with Base64.

Function

apoc.text.byteCount(text STRING, charset STRING) - returns the size of the given STRING in bytes.

Function

apoc.text.bytes(text STRING, charset STRING) - returns the given STRING as bytes.

Function

apoc.text.camelCase(text STRING) - converts the given STRING to camel case.

Function

apoc.text.capitalize(text STRING) - capitalizes the first letter of the given STRING.

Function

apoc.text.capitalizeAll(text STRING) - capitalizes the first letter of every word in the given STRING.

Function

apoc.text.charAt(text STRING, index INTEGER) - returns the INTEGER value of the character at the given index.

Function

apoc.text.clean(text STRING) - strips the given STRING of everything except alpha numeric characters and converts it to lower case.

Function

apoc.text.code(codepoint INTEGER) - converts the INTEGER value into a STRING.

Function

apoc.text.compareCleaned(text1 STRING, text2 STRING) - compares two given STRING values stripped of everything except alpha numeric characters converted to lower case.

Function

apoc.text.decapitalize(text STRING) - turns the first letter of the given STRING from upper case to lower case.

Function

apoc.text.decapitalizeAll(text STRING) - turns the first letter of every word in the given STRING to lower case.

Function

apoc.text.distance(text1 STRING, text2 STRING) - compares the two given STRING values using the Levenshtein distance algorithm.

Function

apoc.text.doubleMetaphone(value STRING) - returns the double metaphone phonetic encoding of all words in the given STRING value.

Function

apoc.text.format(text STRING, params LIST<ANY>, language STRING) - formats the given STRING with the given parameters.

Function

apoc.text.fuzzyMatch(text1 STRING, text2 STRING) - performs a fuzzy match search of the two given STRING values.

Function

apoc.text.hammingDistance(text1 STRING, text2 STRING) - compares the two given STRING values using the Hamming distance algorithm.

Function

apoc.text.hexCharAt(text STRING, index INTEGER) - returns the hexadecimal value of the given STRING at the given index.

Function

apoc.text.hexValue(value INTEGER) - returns the hexadecimal value of the given value.

Function

apoc.text.indexOf(text STRING, lookup STRING, from INTEGER, to INTEGER) - returns the first occurrence of the lookup STRING in the given STRING, or -1 if not found.

Function

apoc.text.indexesOf(text STRING, lookup STRING, from INTEGER, to INTEGER) - returns all occurrences of the lookup STRING in the given STRING, or an empty list if not found.

Function

apoc.text.jaroWinklerDistance(text1 STRING, text2 STRING) - compares the two given STRING values using the Jaro-Winkler distance algorithm.

Function

apoc.text.join(texts LIST<STRING>, delimiter STRING) - joins the given STRING values using the given delimiter.

Function

apoc.text.levenshteinDistance(text1 STRING, text2 STRING) - compares the given STRING values using the Levenshtein distance algorithm.

Function

apoc.text.levenshteinSimilarity(text1 STRING, text2 STRING) - returns the similarity (a value within 0 and 1) between the two given STRING values based on the Levenshtein distance algorithm.

Function

apoc.text.lpad(text STRING, count INTEGER, delimiter STRING) - left pads the given STRING by the given width.

Function

apoc.text.phonetic(text STRING) - returns the US_ENGLISH phonetic soundex encoding of all words of the STRING.

Function

apoc.text.random(length INTEGER, valid STRING) - generates a random STRING to the given length using a length parameter and an optional STRING of valid characters. Unsuitable for cryptographic use-cases.

Function

apoc.text.regexGroups(text STRING, regex STRING) - returns all groups matching the given regular expression in the given text.

Function

apoc.text.regreplace(text STRING, regex STRING, replacement STRING) - finds and replaces all matches found by the given regular expression with the given replacement.

Function

apoc.text.repeat(item STRING, count INTEGER) - returns the result of the given item multiplied by the given count.

Function

apoc.text.replace(text STRING, regex STRING, replacement STRING) - finds and replaces all matches found by the given regular expression with the given replacement.

Function

apoc.text.rpad(text STRING, count INTEGER, delimiter STRING) - right pads the given STRING by the given width.

Function

apoc.text.slug(text STRING, delimiter STRING) - replaces the whitespace in the given STRING with the given delimiter.

Function

apoc.text.snakeCase(text STRING) - converts the given STRING to snake case.

Function

apoc.text.sorensenDiceSimilarityWithLanguage(text1 STRING, text2 STRING, languageTag STRING) - compares the two given STRING values using the Sørensen–Dice coefficient formula, with the provided IETF language tag.

Function

apoc.text.split(text STRING, regex STRING, limit INTEGER) - splits the given STRING using a given regular expression as a separator.

Function

apoc.text.swapCase(text STRING) - swaps the cases in the given STRING.

Function

apoc.text.toCypher(value ANY, config MAP<STRING, ANY>) - converts the given value to a Cypher property STRING.

Function

apoc.text.toUpperCase(text STRING) - converts the given STRING to upper case.

Function

apoc.text.upperCamelCase(text STRING) - converts the given STRING to upper camel case.

Function

apoc.text.urldecode(text STRING) - decodes the given URL encoded STRING.

Function

apoc.text.urlencode(text STRING) - encodes the given URL STRING.

Function

apoc.trigger

Qualified Name Type

apoc.trigger.add(name STRING, statement STRING, selector MAP<STRING, ANY>, config MAP<STRING, ANY>) - adds a trigger to the given Cypher statement. The selector for this procedure is {phase:'before/after/rollback/afterAsync'}.

Procedure Deprecated

apoc.trigger.drop(databaseName STRING, name STRING) - eventually removes the given trigger.

Procedure

apoc.trigger.dropAll(databaseName STRING) - eventually removes all triggers from the given database.

Procedure

apoc.trigger.install(databaseName STRING, name STRING, statement STRING, selector MAP<STRING, ANY>, config MAP<STRING, ANY>) - eventually adds a trigger for a given database which is invoked when a successful transaction occurs.

Procedure

apoc.trigger.list() - lists all currently installed triggers for the session database.

Procedure

apoc.trigger.pause(name STRING) - pauses the given trigger.

Procedure Deprecated

apoc.trigger.remove(name STRING) - removes the given trigger.

Procedure Deprecated

apoc.trigger.removeAll() - removes all previously added triggers.

Procedure Deprecated

apoc.trigger.resume(name STRING) - resumes the given paused trigger.

Procedure Deprecated

apoc.trigger.show(databaseName STRING) - lists all eventually installed triggers for a database.

Procedure

apoc.trigger.start(databaseName STRING, name STRING) - eventually restarts the given paused trigger.

Procedure

apoc.trigger.stop(databaseName STRING, name STRING) - eventually stops the given trigger.

Procedure

apoc.util

Qualified Name Type

apoc.util.sleep(duration INTEGER) - causes the currently running Cypher to sleep for the given duration of milliseconds (the transaction termination is honored).

Procedure

apoc.util.validate(predicate BOOLEAN, message STRING, params LIST<ANY>) - if the given predicate is true an exception is thrown.

Procedure

apoc.util.compress(data STRING, config MAP<STRING, ANY>) - zips the given STRING.

Function

apoc.util.decompress(data LIST<INTEGER>, config MAP<STRING, ANY>) - unzips the given byte array.

Function

apoc.util.md5(values LIST<ANY>) - returns the MD5 checksum of the concatenation of all STRING values in the given LIST<ANY>. MD5 is a weak hashing algorithm which is unsuitable for cryptographic use-cases.

Function

apoc.util.sha1(values LIST<ANY>) - returns the SHA1 of the concatenation of all STRING values in the given LIST<ANY>. SHA1 is a weak hashing algorithm which is unsuitable for cryptographic use-cases.

Function

apoc.util.sha256(values LIST<ANY>) - returns the SHA256 of the concatenation of all STRING values in the given LIST<ANY>.

Function

apoc.util.sha384(values LIST<ANY>) - returns the SHA384 of the concatenation of all STRING values in the given LIST<ANY>.

Function

apoc.util.sha512(values LIST<ANY>) - returns the SHA512 of the concatenation of all STRING values in the LIST<ANY>.

Function

apoc.util.validatePredicate(predicate BOOLEAN, message STRING, params LIST<ANY>) - if the given predicate is true an exception is thrown, otherwise it returns true (for use inside WHERE subclauses).

Function

apoc.warmup

Qualified Name Type

apoc.warmup.run(loadProperties BOOLEAN, loadDynamicProperties BOOLEAN, loadIndexes BOOLEAN) - loads all NODE and RELATIONSHIP values in the database into memory.

Procedure Deprecated

apoc.xml

Qualified Name Type

apoc.xml.parse(data STRING, path STRING, config MAP<STRING, ANY>, simple BOOLEAN) - parses the given XML STRING as a MAP.

Function