APOC support

APOC (Awesome Procedures on Cypher) is a Neo4j library that provides access to additional procedures and functions, extending the use of the Cypher query language. For more information on APOC, see the APOC documentation.

A subset of the APOC Core functions and procedures are pre-installed and available in Aura, as shown below:

apoc

Qualified Name Type

apoc.case
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
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
Returns the first value from the given collection.

Function

apoc.agg.graph
Returns all distinct NODE and RELATIONSHIP values collected into a MAP with the keys nodes and relationships.

Function

apoc.agg.last
Returns the last value from the given collection.

Function

apoc.agg.maxItems
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
Returns the mathematical median for all non-null INTEGER and FLOAT values.

Function

apoc.agg.minItems
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
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
Returns the given percentiles over the range of numerical values in the given collection.

Function

apoc.agg.product
Returns the product of all non-null INTEGER and FLOAT values in the collection.

Function

apoc.agg.slice
Returns a 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
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
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
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
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
Returns all RELATIONSHIP values connecting the given set of NODE values.

Procedure

apoc.algo.dijkstra
Runs Dijkstra’s algorithm using the given RELATIONSHIP property as the cost function.

Procedure

apoc.any

Qualified Name Type

apoc.any.properties
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
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
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
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
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
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
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
Updates the value of a property with a Cypher operation.

Procedure

apoc.bitwise

Qualified Name Type

apoc.bitwise.op
Returns the result of the bitwise operation

Function

apoc.coll

Qualified Name Type

apoc.coll.avg
Returns the average of the numbers in the LIST<INTEGER | FLOAT>.

Function

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

Function

apoc.coll.contains
Returns whether or not the given value exists in the given collection (using a HashSet).

Function

apoc.coll.containsAll
Returns whether or not all of the given values exist in the given collection (using a HashSet).

Function

apoc.coll.containsAllSorted
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
Returns true if a collection contains duplicate elements.

Function

apoc.coll.containsSorted
Returns whether or not the given value exists in an already sorted collection (using a binary search).

Function

apoc.coll.different
Returns true if all the values in the given LIST<ANY> are unique.

Function

apoc.coll.disjunction
Returns the disjunct set from two LIST<ANY> values.

Function

apoc.coll.dropDuplicateNeighbors
Removes duplicate consecutive objects in the LIST<ANY>.

Function

apoc.coll.duplicates
Returns a LIST<ANY> of duplicate items in the collection.

Function

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

Function

apoc.coll.elements
Deconstructs a LIST<ANY> into identifiers indicating their specific type.

Procedure

apoc.coll.fill
Returns a LIST<ANY> with the given count of items.

Function

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

Function

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

Function

apoc.coll.frequenciesAsMap
Returns a MAP of frequencies of the items in the collection, keyed by item and count.

Function

apoc.coll.indexOf
Returns the index for the first occurrence of the specified value in the LIST<ANY>.

Function

apoc.coll.insert
Inserts a value into the specified index in the LIST<ANY>.

Function

apoc.coll.insertAll
Inserts all of the values into the LIST<ANY>, starting at the specified index.

Function

apoc.coll.intersection
Returns the distinct intersection of two LIST<ANY> values.

Function

apoc.coll.isEqualCollection
Returns true if the two collections contain the same elements with the same cardinality in any order (using a HashMap).

Function

apoc.coll.max
Returns the maximum of all values in the given LIST<ANY>.

Function

apoc.coll.min
Returns the minimum of all values in the given LIST<ANY>.

Function

apoc.coll.occurrences
Returns the count of the given item in the collection.

Function

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

Function

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

Function

apoc.coll.partition
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.partition
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.

Procedure

apoc.coll.randomItem
Returns a random item from the LIST<ANY>, or null on LIST<NOTHING> or LIST<NULL>.

Function

apoc.coll.randomItems
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
Removes a range of values from the LIST<ANY>, beginning at position index for the given length of values.

Function

apoc.coll.removeAll
Returns the first LIST<ANY> with all elements also present in the second LIST<ANY> removed.

Function

apoc.coll.runningTotal
Returns an accumulative LIST<INTEGER | FLOAT>.

Function

apoc.coll.set
Sets the element at the given index to the new value.

Function

apoc.coll.shuffle
Returns the LIST<ANY> shuffled.

Function

apoc.coll.sort
Sorts the given LIST<ANY> into ascending order.

Function

apoc.coll.sortMaps
Sorts the given LIST<MAP<STRING, ANY>> into descending order, based on the MAP property indicated by prop.

Function

apoc.coll.sortMulti
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
Sorts the given LIST<NODE> by the property of the nodes into descending order.

Function

apoc.coll.sortText
Sorts the given LIST<STRING> into ascending order.

Function

apoc.coll.split
Splits a collection by the given value. The value itself will not be part of the resulting LIST<ANY> values.

Procedure

apoc.coll.subtract
Returns the first LIST<ANY> as a set with all the elements of the second LIST<ANY> removed.

Function

apoc.coll.sum
Returns the sum of all the INTEGER | FLOAT in the LIST<INTEGER | FLOAT>.

Function

apoc.coll.sumLongs
Returns the sum of all the INTEGER | FLOAT in the LIST<INTEGER | FLOAT>.

Function

apoc.coll.toSet
Returns a unique LIST<ANY> from the given LIST<ANY>.

Function

apoc.coll.union
Returns the distinct union of the two given LIST<ANY> values.

Function

apoc.coll.unionAll
Returns the full union of the two given LIST<ANY> values (duplicates included).

Function

apoc.coll.zip
Returns the two given LIST<ANY> values zipped together as a LIST<LIST<ANY>>.

Function

apoc.coll.zipToRows
Returns the two LIST<ANY> values zipped together, with one row per zipped pair.

Procedure

apoc.convert

Qualified Name Type

apoc.convert.fromJsonList
Converts the given JSON list into a Cypher LIST<STRING>.

Function

apoc.convert.fromJsonMap
Converts the given JSON map into a Cypher MAP.

Function

apoc.convert.getJsonProperty
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
Converts a serialized JSON object from the property of the given NODE into a Cypher MAP.

Function

apoc.convert.setJsonProperty
Serializes the given JSON object and sets it as a property on the given NODE.

Procedure

apoc.convert.toJson
Serializes the given JSON value.

Function

apoc.convert.toList
Converts the given value into a LIST<ANY>.

Function

apoc.convert.toMap
Converts the given value into a MAP.

Function

apoc.convert.toNode
Converts the given value into a NODE.

Function

apoc.convert.toNodeList
Converts the given value into a LIST<NODE>.

Function

apoc.convert.toRelationship
Converts the given value into a RELATIONSHIP.

Function

apoc.convert.toRelationshipList
Converts the given value into a LIST<RELATIONSHIP>.

Function

apoc.convert.toSet
Converts the given value into a set represented in Cypher as a LIST<ANY>.

Function

apoc.convert.toSortedJsonMap
Converts a serialized JSON object from the property of a given NODE into a Cypher MAP.

Function

apoc.convert.toTree
Returns a stream of MAP values, representing the given PATH values as a tree with at least one root.

Procedure

apoc.create

Qualified Name Type

apoc.create.addLabels
Adds the given labels to the given NODE values.

Procedure

apoc.create.node
Creates a NODE with the given dynamic labels.

Procedure

apoc.create.nodes
Creates NODE values with the given dynamic labels.

Procedure

apoc.create.relationship
Creates a RELATIONSHIP with the given dynamic relationship type.

Procedure

apoc.create.removeLabels
Removes the given labels from the given NODE values.

Procedure

apoc.create.removeProperties
Removes the given properties from the given NODE values.

Procedure

apoc.create.removeRelProperties
Removes the given properties from the given RELATIONSHIP values.

Procedure

apoc.create.setLabels
Sets the given labels to the given NODE values. Non-matching labels are removed from the nodes.

Procedure

apoc.create.setProperties
Sets the given properties to the given NODE values.

Procedure

apoc.create.setProperty
Sets the given property to the given NODE values.

Procedure

apoc.create.setRelProperties
Sets the given properties on the RELATIONSHIP values.

Procedure

apoc.create.setRelProperty
Sets the given property on the RELATIONSHIP values.

Procedure

apoc.create.uuid
Returns a UUID.

Function Deprecated

apoc.create.uuids
Returns a stream of UUIDs.

Procedure Deprecated

apoc.create.vNode
Returns a virtual NODE.

Procedure

apoc.create.vNode
Returns a virtual NODE.

Function

apoc.create.vNodes
Returns virtual NODE values.

Procedure

apoc.create.vRelationship
Returns a virtual RELATIONSHIP.

Procedure

apoc.create.vRelationship
Returns a virtual RELATIONSHIP.

Function

apoc.create.virtual.fromNode
Returns a virtual NODE from the given existing NODE. The virtual NODE only contains the requested properties.

Function

apoc.cypher

Qualified Name Type

apoc.cypher.doIt
Runs a dynamically constructed statement with the given parameters. This procedure allows for both read and write statements.

Procedure

apoc.cypher.run
Runs a dynamically constructed read-only statement with the given parameters.

Procedure

apoc.cypher.runFirstColumnMany
Runs the given statement with the given parameters and returns the first column collected into a LIST<ANY>.

Function

apoc.cypher.runFirstColumnSingle
Runs the given statement with the given parameters and returns the first element of the first column.

Function

apoc.cypher.runMany
Runs each semicolon separated statement and returns a summary of the statement outcomes.

Procedure

apoc.cypher.runTimeboxed
Terminates a Cypher statement if it has not finished before the set timeout (ms).

Procedure

apoc.data

Qualified Name Type

apoc.data.url
Turns a URL into a MAP.

Function

apoc.date

Qualified Name Type

apoc.date.add
Adds a unit of specified time to the given timestamp.

Function

apoc.date.convert
Converts the given timestamp from one time unit into a timestamp of a different time unit.

Function

apoc.date.convertFormat
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
Returns the value of one field from the given date time.

Function

apoc.date.fields
Splits the given date into fields returning a MAP containing the values of each field.

Function

apoc.date.format
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
Converts the given date STRING (ISO8601) to an INTEGER representing the time value in milliseconds.

Function

apoc.date.parse
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
Returns a STRING representation of a specified time value in the ISO8601 format.

Function

apoc.date.toYears
Converts the given timestamp or the given date into a FLOAT representing years.

Function

apoc.diff

Qualified Name Type

apoc.diff.nodes
Returns a MAP detailing the differences between the two given NODE values.

Function

apoc.do

Qualified Name Type

apoc.do.case
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
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.csv.all
Exports the full database to the provided CSV file.

Procedure

apoc.export.csv.data
Exports the given NODE and RELATIONSHIP values to the provided CSV file.

Procedure

apoc.export.csv.graph
Exports the given graph to the provided CSV file.

Procedure

apoc.export.csv.query
Exports the results from running the given Cypher query to the provided CSV file.

Procedure

apoc.export.cypher.all
Exports the full database (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.data
Exports the given NODE and RELATIONSHIP values (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.graph
Exports the given graph (incl. indexes) as Cypher statements to the provided file (default: Cypher Shell).

Procedure

apoc.export.cypher.query
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
Exports all schema indexes and constraints to Cypher statements.

Procedure

apoc.export.graphml.all
Exports the full database to the provided GraphML file.

Procedure

apoc.export.graphml.data
Exports the given NODE and RELATIONSHIP values to the provided GraphML file.

Procedure

apoc.export.graphml.graph
Exports the given graph to the provided GraphML file.

Procedure

apoc.export.graphml.query
Exports the given NODE and RELATIONSHIP values from the Cypher statement to the provided GraphML file.

Procedure

apoc.export.json.all
Exports the full database to the provided JSON file.

Procedure

apoc.export.json.data
Exports the given NODE and RELATIONSHIP values to the provided JSON file.

Procedure

apoc.export.json.graph
Exports the given graph to the provided JSON file.

Procedure

apoc.export.json.query
Exports the results from the Cypher statement to the provided JSON file.

Procedure

apoc.graph

Qualified Name Type

apoc.graph.from
Generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the given data.

Procedure

apoc.graph.fromCypher
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.fromDB
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.fromData
Generates a virtual sub-graph by extracting all of the NODE and RELATIONSHIP values from the given data.

Procedure

apoc.graph.fromDocument
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
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
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
Validates the JSON file and returns the result of the validation.

Procedure

apoc.hashing

Qualified Name Type

apoc.hashing.fingerprint
Calculates a MD5 checksum over a NODE or RELATIONSHIP (identical entities share the same checksum). Unsuitable for cryptographic use-cases.

Function

apoc.hashing.fingerprintGraph
Calculates a MD5 checksum over the full graph. This function uses in-memory data structures. Unsuitable for cryptographic use-cases.

Function

apoc.hashing.fingerprinting
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.import

Qualified Name Type

apoc.import.csv
Imports NODE and RELATIONSHIP values with the given labels and types from the provided CSV file.

Procedure

apoc.import.graphml
Imports a graph from the provided GraphML file.

Procedure

apoc.json

Qualified Name Type

apoc.json.path
Returns the given JSON path.

Function

apoc.label

Qualified Name Type

apoc.label.exists
Returns true or false depending on whether or not the given label exists.

Function

apoc.load

Qualified Name Type

apoc.load.json
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
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.xml
Loads a single nested MAP from an XML URL (e.g. web-API).

Procedure

apoc.lock

Qualified Name Type

apoc.lock.all
Acquires a write lock on the given NODE and RELATIONSHIP values.

Procedure

apoc.lock.nodes
Acquires a write lock on the given NODE values.

Procedure

apoc.lock.read.nodes
Acquires a read lock on the given NODE values.

Procedure

apoc.lock.read.rels
Acquires a read lock on the given RELATIONSHIP values.

Procedure

apoc.lock.rels
Acquires a write lock on the given RELATIONSHIP values.

Procedure

apoc.map

Qualified Name Type

apoc.map.clean
Filters the keys and values contained in the given LIST<ANY> values.

Function

apoc.map.flatten
Flattens nested items in the given MAP. This function is the reverse of the apoc.map.unflatten function.

Function

apoc.map.fromLists
Creates a MAP from the keys and values in the given LIST<ANY> values.

Function

apoc.map.fromNodes
Returns a MAP of the given prop to the node of the given label.

Function

apoc.map.fromPairs
Creates a MAP from the given LIST<LIST<ANY>> of key-value pairs.

Function

apoc.map.fromValues
Creates a MAP from the alternating keys and values in the given LIST<ANY>.

Function

apoc.map.get
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
Creates a MAP of the LIST<ANY> keyed by the given property, with single values.

Function

apoc.map.groupByMulti
Creates a MAP of the LIST<ANY> values keyed by the given property, with the LIST<ANY> values.

Function

apoc.map.merge
Merges the two given MAP values into one MAP.

Function

apoc.map.mergeList
Merges all MAP values in the given LIST<MAP<STRING, ANY>> into one MAP.

Function

apoc.map.mget
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
Removes the given key from the MAP (recursively if recursive is true).

Function

apoc.map.removeKeys
Removes the given keys from the MAP (recursively if recursive is true).

Function

apoc.map.setEntry
Adds or updates the given entry in the MAP.

Function

apoc.map.setKey
Adds or updates the given entry in the MAP.

Function

apoc.map.setLists
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
Adds or updates the given key/value pairs (e.g. [key1,value1],[key2,value2]) in a MAP.

Function

apoc.map.setValues
Adds or updates the alternating key/value pairs (e.g. [key1,value1,key2,value2]) in a MAP.

Function

apoc.map.sortedProperties
Returns a LIST<ANY> of key/value pairs. The pairs are sorted by alphabetically by key, with optional case sensitivity.

Function

apoc.map.submap
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
Unflattens items in the given MAP to nested items. This function is the reverse of the apoc.map.flatten function.

Function

apoc.map.updateTree
Adds the data MAP on each level of the nested tree, where the key-value pairs match.

Function

apoc.map.values
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.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.regr
Returns the coefficient of determination (R-squared) for the values of propertyY and propertyX in the given label.

Procedure

apoc.merge

Qualified Name Type

apoc.merge.node
Merges the given NODE values with the given dynamic labels.

Procedure

apoc.merge.node.eager
Merges the given NODE values with the given dynamic labels eagerly.

Procedure

apoc.merge.relationship
Merges the given RELATIONSHIP values with the given dynamic types/properties.

Procedure

apoc.merge.relationship.eager
Merges the given RELATIONSHIP values with the given dynamic types/properties eagerly.

Procedure

apoc.meta

Qualified Name Type

apoc.meta.cypher.isType
Returns true if the given value matches the given type.

Function

apoc.meta.cypher.type
Returns the type name of the given value.

Function

apoc.meta.cypher.types
Returns a MAP containing the type names of the given values.

Function

apoc.meta.data
Examines the full graph and returns a table of metadata.

Procedure

apoc.meta.graph
Examines the full graph and returns a meta-graph.

Procedure

apoc.meta.graphSample
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
Examines the full graph and returns a table of metadata with information about the NODE values therein.

Procedure

apoc.meta.relTypeProperties
Examines the full graph and returns a table of metadata with information about the RELATIONSHIP values therein.

Procedure

apoc.meta.schema
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
Examines the given sub-graph and returns a meta-graph.

Procedure

apoc.neighbors

Qualified Name Type

apoc.neighbors.athop
Returns all NODE values connected by the given RELATIONSHIP types at the specified distance.

Procedure

apoc.neighbors.athop.count
Returns the count of all NODE values connected by the given RELATIONSHIP types at the specified distance.

Procedure

apoc.neighbors.byhop
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
Returns the count of all NODE values connected by the given RELATIONSHIP types within the specified distance.

Procedure

apoc.neighbors.tohop
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
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
Returns the total degrees of the given NODE.

Function

apoc.node.degree.in
Returns the total number of incoming RELATIONSHIP values connected to the given NODE.

Function

apoc.node.degree.out
Returns the total number of outgoing RELATIONSHIP values from the given NODE.

Function

apoc.node.id
Returns the id for the given virtual NODE.

Function

apoc.node.labels
Returns the labels for the given virtual NODE.

Function

apoc.node.relationship.exists
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
Returns a LIST<STRING> of distinct RELATIONSHIP types for the given NODE.

Function

apoc.node.relationships.exist
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
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.connected
Returns true when a given NODE is directly connected to another given NODE. This function is optimized for dense nodes.

Function

apoc.nodes.delete
Deletes all NODE values with the given ids.

Procedure

apoc.nodes.get
Returns all NODE values with the given ids.

Procedure

apoc.nodes.group
Allows for the aggregation of NODE values based on the given properties. This procedure returns virtual NODE values.

Procedure

apoc.nodes.isDense
Returns true if the given NODE is a dense node.

Function

apoc.nodes.link
Creates a linked list of the given NODE values connected by the given RELATIONSHIP type.

Procedure

apoc.nodes.relationship.types
Returns a LIST<STRING> of distinct RELATIONSHIP types from the given LIST<NODE> values.

Function

apoc.nodes.relationships.exist
Returns a BOOLEAN based on whether or not the given NODE values have the given RELATIONSHIP values.

Function

apoc.nodes.rels
Returns all RELATIONSHIP values with the given ids.

Procedure

apoc.number

Qualified Name Type

apoc.number.arabicToRoman
Converts the given Arabic numbers to Roman numbers.

Function

apoc.number.exact.add
Returns the result of adding the two given large numbers (using Java BigDecimal).

Function

apoc.number.exact.div
Returns the result of dividing a given large number with another given large number (using Java BigDecimal).

Function

apoc.number.exact.mul
Returns the result of multiplying two given large numbers (using Java BigDecimal).

Function

apoc.number.exact.sub
Returns the result of subtracting a given large number from another given large number (using Java BigDecimal).

Function

apoc.number.exact.toExact
Returns the exact value of the given number (using Java BigDecimal).

Function

apoc.number.exact.toFloat
Returns the FLOAT of the given large number (using Java BigDecimal).

Function

apoc.number.exact.toInteger
Returns the INTEGER of the given large number (using Java BigDecimal).

Function

apoc.number.format
Formats the given INTEGER or FLOAT using the given pattern and language to produce a STRING.

Function

apoc.number.parseFloat
Parses the given STRING using the given pattern and language to produce a FLOAT.

Function

apoc.number.parseInt
Parses the given STRING using the given pattern and language to produce a INTEGER.

Function

apoc.number.romanToArabic
Converts the given Roman numbers to Arabic numbers.

Function

apoc.path

Qualified Name Type

apoc.path.combine
Combines the two given PATH values into one PATH.

Function

apoc.path.create
Returns a PATH from the given start NODE and LIST<RELATIONSHIP>.

Function

apoc.path.elements
Converts the given PATH into a LIST<NODE | RELATIONSHIP>.

Function

apoc.path.expand
Returns PATH values expanded from the start NODE following the given RELATIONSHIP types from min-depth to max-depth.

Procedure

apoc.path.expandConfig
Returns PATH values expanded from the start NODE with the given RELATIONSHIP types from min-depth to max-depth.

Procedure

apoc.path.slice
Returns a new PATH of the given length, taken from the given PATH at the given offset.

Function

apoc.path.spanningTree
Returns spanning tree PATH values expanded from the start NODE following the given RELATIONSHIP types to max-depth.

Procedure

apoc.path.subgraphAll
Returns the sub-graph reachable from the start NODE following the given RELATIONSHIP types to max-depth.

Procedure

apoc.path.subgraphNodes
Returns the NODE values in the sub-graph reachable from the start NODE following the given RELATIONSHIP types to max-depth.

Procedure

apoc.periodic

Qualified Name Type

apoc.periodic.cancel
Cancels the given background job.

Procedure

apoc.periodic.commit
Runs the given statement in separate batched transactions.

Procedure

apoc.periodic.countdown
Runs a repeatedly called background statement until it returns 0.

Procedure

apoc.periodic.iterate
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
Runs a repeatedly called background job. To stop this procedure, use apoc.periodic.cancel.

Procedure

apoc.periodic.submit
Creates a background job which runs the given Cypher statement once.

Procedure

apoc.refactor

Qualified Name Type

apoc.refactor.categorize
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
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
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
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
Collapses the given NODE and replaces it with a RELATIONSHIP of the given type.

Procedure

apoc.refactor.extractNode
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
Redirects the given RELATIONSHIP to the given start NODE.

Procedure

apoc.refactor.invert
Inverts the direction of the given RELATIONSHIP.

Procedure

apoc.refactor.mergeNodes
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
Merges the given LIST<RELATIONSHIP> onto the first RELATIONSHIP in the LIST<RELATIONSHIP>.

Procedure

apoc.refactor.normalizeAsBoolean
Refactors the given property to a BOOLEAN.

Procedure

apoc.refactor.rename.label
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
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
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
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
Changes the type of the given RELATIONSHIP.

Procedure

apoc.refactor.to
Redirects the given RELATIONSHIP to the given end NODE.

Procedure

apoc.rel

Qualified Name Type

apoc.rel.id
Returns the id for the given virtual RELATIONSHIP.

Function

apoc.rel.type
Returns the type for the given virtual RELATIONSHIP.

Function

apoc.schema

Qualified Name Type

apoc.schema.assert
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.node.constraintExists
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
Returns a BOOLEAN depending on whether or not an index exists for the given NODE label with the given property names.

Function

apoc.schema.nodes
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
Returns all distinct NODE property values for the given key.

Procedure

apoc.schema.properties.distinctCount
Returns all distinct property values and counts for the given key.

Procedure

apoc.schema.relationship.constraintExists
Returns a BOOLEAN depending on whether or not a constraint exists for the given RELATIONSHIP type with the given property names.

Function

apoc.schema.relationships
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.scoring

Qualified Name Type

apoc.scoring.existence
Returns the given score if true, 0 if false.

Function

apoc.scoring.pareto
Applies a Pareto scoring function over the given INTEGER values.

Function

Qualified Name Type

apoc.search.multiSearchReduced
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
Returns all the distinct NODE values found after a parallel search over multiple indexes.

Procedure

apoc.search.nodeAll
Returns all the NODE values found after a parallel search over multiple indexes.

Procedure

apoc.search.nodeAllReduced
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
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
Returns the geographic location (latitude, longitude, and description) of the given address using a geocoding service (default: OpenStreetMap).

Procedure

apoc.spatial.geocodeOnce
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
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
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
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
Formats the given temporal value into the given time format.

Function

apoc.temporal.formatDuration
Formats the given duration into the given time format.

Function

apoc.temporal.toZonedTemporal
Parses the given date STRING using the specified format into the given time zone.

Function

apoc.text

Qualified Name Type

apoc.text.base64Decode
Decodes the given Base64 encoded STRING.

Function

apoc.text.base64Encode
Encodes the given STRING with Base64.

Function

apoc.text.base64UrlDecode
Decodes the given Base64 encoded URL.

Function

apoc.text.base64UrlEncode
Encodes the given URL with Base64.

Function

apoc.text.byteCount
Returns the size of the given STRING in bytes.

Function

apoc.text.bytes
Returns the given STRING as bytes.

Function

apoc.text.camelCase
Converts the given STRING to camel case.

Function

apoc.text.capitalize
Capitalizes the first letter of the given STRING.

Function

apoc.text.capitalizeAll
Capitalizes the first letter of every word in the given STRING.

Function

apoc.text.charAt
Returns the INTEGER value of the character at the given index.

Function

apoc.text.clean
Strips the given STRING of everything except alpha numeric characters and converts it to lower case.

Function

apoc.text.code
Converts the INTEGER value into a STRING.

Function

apoc.text.compareCleaned
Compares two given STRING values stripped of everything except alpha numeric characters converted to lower case.

Function

apoc.text.decapitalize
Turns the first letter of the given STRING from upper case to lower case.

Function

apoc.text.decapitalizeAll
Turns the first letter of every word in the given STRING to lower case.

Function

apoc.text.distance
Compares the two given STRING values using the Levenshtein distance algorithm.

Function

apoc.text.doubleMetaphone
Returns the double metaphone phonetic encoding of all words in the given STRING value.

Function

apoc.text.format
Formats the given STRING with the given parameters.

Function

apoc.text.fuzzyMatch
Performs a fuzzy match search of the two given STRING values.

Function

apoc.text.hammingDistance
Compares the two given STRING values using the Hamming distance algorithm.

Function

apoc.text.hexCharAt
Returns the hexadecimal value of the given STRING at the given index.

Function

apoc.text.hexValue
Returns the hexadecimal value of the given value.

Function

apoc.text.indexOf
Returns the first occurrence of the lookup STRING in the given STRING, or -1 if not found.

Function

apoc.text.indexesOf
Returns all occurrences of the lookup STRING in the given STRING, or an empty list if not found.

Function

apoc.text.jaroWinklerDistance
Compares the two given STRING values using the Jaro-Winkler distance algorithm.

Function

apoc.text.join
Joins the given STRING values using the given delimiter.

Function

apoc.text.levenshteinDistance
Compares the given STRING values using the Levenshtein distance algorithm.

Function

apoc.text.levenshteinSimilarity
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
Left pads the given STRING by the given width.

Function

apoc.text.phonetic
Returns the US_ENGLISH phonetic soundex encoding of all words of the STRING.

Function

apoc.text.phoneticDelta
Returns the US_ENGLISH soundex character difference between the two given STRING values.

Procedure

apoc.text.random
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
Returns all groups matching the given regular expression in the given text.

Function

apoc.text.regreplace
Finds and replaces all matches found by the given regular expression with the given replacement.

Function

apoc.text.repeat
Returns the result of the given item multiplied by the given count.

Function

apoc.text.replace
Finds and replaces all matches found by the given regular expression with the given replacement.

Function

apoc.text.rpad
Right pads the given STRING by the given width.

Function

apoc.text.slug
Replaces the whitespace in the given STRING with the given delimiter.

Function

apoc.text.snakeCase
Converts the given STRING to snake case.

Function

apoc.text.sorensenDiceSimilarity
Compares the two given STRING values using the Sørensen–Dice coefficient formula, with the provided IETF language tag.

Function

apoc.text.split
Splits the given STRING using a given regular expression as a separator.

Function

apoc.text.swapCase
Swaps the cases in the given STRING.

Function

apoc.text.toCypher
Converts the given value to a Cypher property STRING.

Function

apoc.text.toUpperCase
Converts the given STRING to upper case.

Function

apoc.text.upperCamelCase
Converts the given STRING to upper camel case.

Function

apoc.text.urldecode
Decodes the given URL encoded STRING.

Function

apoc.text.urlencode
Encodes the given URL STRING.

Function

apoc.util

Qualified Name Type

apoc.util.md5
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
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
Returns the SHA256 of the concatenation of all STRING values in the given LIST<ANY>.

Function

apoc.util.sha384
Returns the SHA384 of the concatenation of all STRING values in the given LIST<ANY>.

Function

apoc.util.sha512
Returns the SHA512 of the concatenation of all STRING values in the LIST<ANY>.

Function

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

Procedure

apoc.util.validate
If the given predicate is true an exception is thrown.

Procedure

apoc.util.validatePredicate
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
Loads all NODE and RELATIONSHIP values in the database into memory.

Procedure Deprecated

apoc.xml

Qualified Name Type

apoc.xml.parse
Parses the given XML STRING as a MAP.

Function