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, this procedure will run the first query for which the conditional is evaluated to true.

Procedure

apoc.help
Returns descriptions of the available APOC procedures and functions.

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 nodes and relationships 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:[], value:n} where the value key is the maximum value present, and items represent all items with the same value.

Function

apoc.agg.median
Returns the mathematical median for all non-null numeric values.

Function

apoc.agg.minItems
Returns a map {items:[], value:n} where the value key is the minimum value present, and items represent all items with the same value.

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 numerical 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 numerical 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 nodes, 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 nodes, 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 relationships, up to a max depth described by maxNodes.

Procedure

apoc.algo.cover
Returns all relationships between a given set of nodes.

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 number 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 array 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 array value of a property. The procedure then sets the property to the resulting array value.

Procedure

apoc.atomic.subtract
Sets the property of a value to itself minus the given number 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.

Function

apoc.coll.combinations
Returns a collection of all combinations of list 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 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 any of the values in the given list are different.

Function

apoc.coll.disjunction
Returns the disjunct set of two lists.

Function

apoc.coll.dropDuplicateNeighbors
Removes duplicate consecutive objects in the list.

Function

apoc.coll.duplicates
Returns a list of duplicate items in the collection.

Function

apoc.coll.duplicatesWithCount
Returns a list of duplicate items in the collection and their count, keyed by item and count.

Function

apoc.coll.elements
Deconstructs a list of mixed types into identifiers indicating their specific type.

Procedure

apoc.coll.fill
Returns a list with the given count of items.

Function

apoc.coll.flatten
Flattens the given list (to flatten nested lists, set recursive to true).

Function

apoc.coll.frequencies
Returns a list 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.

Function

apoc.coll.insert
Inserts a value into the specified index in the list.

Function

apoc.coll.insertAll
Inserts all of the values into the list, starting at the specified index.

Function

apoc.coll.intersection
Returns the distinct intersection of two lists.

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.

Function

apoc.coll.min
Returns the minimum of all values in the given list.

Function

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

Function

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

Function

apoc.coll.pairsMin
Returns lists of adjacent elements in the list ([1,2],[2,3]), skipping the final element.

Function

apoc.coll.partition
apoc.coll.partition(list,batchSize)

Function

apoc.coll.partition
Partitions the original list into sub-lists of the given batch size. The final list may be smaller than the given batch size.

Procedure

apoc.coll.randomItem
Returns a random item from the list, or null on an empty or null list.

Function

apoc.coll.randomItems
Returns a list of itemCount random items from the original list (optionally allowing elements in the original list to be selected more than once).

Function

apoc.coll.remove
Removes a range of values from the list, beginning at position index for the given length of values.

Function

apoc.coll.removeAll
Returns the first list with all elements of the second list removed.

Function

apoc.coll.runningTotal
Returns an accumulative array.

Function

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

Function

apoc.coll.shuffle
Returns the list shuffled.

Function

apoc.coll.sort
Sorts the given list into ascending order.

Function

apoc.coll.sortMaps
Sorts the given list into ascending order, based on the map property indicated by prop.

Function

apoc.coll.sortMulti
Sorts the given list of maps 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 and to skip values.

Function

apoc.coll.sortNodes
Sorts the given list of nodes by their property into ascending order.

Function

apoc.coll.sortText
Sorts the given list of strings into ascending order.

Function

apoc.coll.split
Splits a collection by the given value. The value itself will not be part of the resulting lists.

Procedure

apoc.coll.subtract
Returns the first list as a set with all the elements of the second list removed.

Function

apoc.coll.sum
Returns the sum of all the numbers in the list.

Function

apoc.coll.sumLongs
Returns the sum of all the numbers in the list.

Function

apoc.coll.toSet
Returns a unique list from the given list.

Function

apoc.coll.union
Returns the distinct union of the two given lists.

Function

apoc.coll.unionAll
Returns the full union of the two given lists (duplicates included).

Function

apoc.coll.zip
Returns the two given lists zipped together as a list of lists.

Function

apoc.coll.zipToRows
Returns the two lists 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.

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).

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.

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 of nodes.

Function

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

Function

apoc.convert.toRelationshipList
Converts the given value into a list of relationships.

Function

apoc.convert.toSet
Converts the given value into a set.

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 maps, representing the given paths as a tree with at least one root.

Procedure

apoc.create

Qualified Name Type

apoc.create.addLabels
Adds the given labels to the given nodes.

Procedure

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

Procedure

apoc.create.nodes
Creates nodes 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(s).

Procedure

apoc.create.removeProperties
Removes the given properties from the given node(s).

Procedure

apoc.create.removeRelProperties
Removes the given properties from the given relationship(s).

Procedure

apoc.create.setLabels
Sets the given labels to the given node(s). Non-matching labels are removed from the nodes.

Procedure

apoc.create.setProperties
Sets the given properties to the given node(s).

Procedure

apoc.create.setProperty
Sets the given property to the given node(s).

Procedure

apoc.create.setRelProperties
Sets the given properties on the relationship(s).

Procedure

apoc.create.setRelProperty
Sets the given property on the relationship(s).

Procedure

apoc.create.uuid
Returns a UUID.

Function

apoc.create.uuids
Returns a stream of UUIDs.

Procedure

apoc.create.vNode
Returns a virtual node.

Procedure

apoc.create.vNode
Returns a virtual node.

Function

apoc.create.vNodes
Returns virtual nodes.

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.

Function

apoc.cypher

Qualified Name Type

apoc.cypher.doIt
Runs a dynamically constructed string with the given parameters.

Procedure

apoc.cypher.run
Runs a dynamically constructed read-only string 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.

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 floating point representing years.

Function

apoc.diff

Qualified Name Type

Function

apoc.do

Qualified Name Type

apoc.do.case
For each pair of conditional queries in the given list, this procedure will run the first query for which the conditional is evaluated to true.

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 nodes and relationships 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 nodes and relationships (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 nodes and relationships 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 nodes and relationships 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 nodes and relationships 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 nodes and relationships 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 nodes and relationships from the given data.

Procedure

apoc.graph.fromCypher
Generates a virtual sub-graph by extracting all of the nodes and relationships from the data returned by the given Cypher statement.

Procedure

apoc.graph.fromDB
Generates a virtual sub-graph by extracting all of the nodes and relationships from the data returned by the given database.

Procedure

apoc.graph.fromData
Generates a virtual sub-graph by extracting all of the nodes and relationships from the given data.

Procedure

apoc.graph.fromDocument
Generates a virtual sub-graph by extracting all of the nodes and relationships from the data returned by the given JSON file.

Procedure

apoc.graph.fromPath
Generates a virtual sub-graph by extracting all of the nodes and relationships from the data returned by the given path.

Procedure

apoc.graph.fromPaths
Generates a virtual sub-graph by extracting all of the nodes and relationships from the data returned by the given paths.

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 a 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 a 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 nodes and relationships 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 an array. 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 nodes and relationships.

Procedure

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

Procedure

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

Procedure

apoc.lock.read.rels
Acquires a read lock on the given relationships.

Procedure

apoc.lock.rels
Acquires a write lock on the given relationships.

Procedure

apoc.map

Qualified Name Type

apoc.map.clean
Filters the keys and values contained in the given lists.

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 lists.

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 of key-value pairs.

Function

apoc.map.fromValues
Creates a map from the alternating keys and values in the given list.

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 keyed by the given property, with single values.

Function

apoc.map.groupByMulti
Creates a map of the lists keyed by the given property, with the list values.

Function

apoc.map.merge
Merges the two given maps into one map.

Function

apoc.map.mergeList
Merges all maps in the given list into one map.

Function

apoc.map.mget
Returns a list of values 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 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 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 of values 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(s) with the given dynamic labels.

Procedure

apoc.merge.node.eager
Merges the given node(s) with the given dynamic labels eagerly.

Procedure

apoc.merge.relationship
Merges the given relationship(s) with the given dynamic types/properties.

Procedure

apoc.merge.relationship.eager
Merges the given relationship(s) 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 nodes therein.

Procedure

apoc.meta.relTypeProperties
Examines the full graph and returns a table of metadata with information about the relationships 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 nodes connected by the given relationship types at the specified distance.

Procedure

apoc.neighbors.athop.count
Returns the count of all nodes connected by the given relationship types at the specified distance.

Procedure

apoc.neighbors.byhop
Returns all nodes connected by the given relationship types within the specified distance.

Procedure

apoc.neighbors.byhop.count
Returns the count of all nodes connected by the given relationship types within the specified distance.

Procedure

apoc.neighbors.tohop
Returns all nodes connected by the given relationship types within the specified distance. Nodes are returned individually for each row.

Procedure

apoc.neighbors.tohop.count
Returns the count of all nodes connected by the given relationships in the pattern within the specified distance.

Procedure

apoc.node

Qualified Name Type

apoc.node.degree
Returns the total degrees for the given node.

Function

apoc.node.degree.in
Returns the total number of incoming relationships to the given node.

Function

apoc.node.degree.out
Returns the total number of outgoing relationships 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 relationship (or whether the given node has a relationship of the given type and direction).

Function

apoc.node.relationship.types
Returns a list of distinct relationship types for the given node.

Function

apoc.node.relationships.exist
Returns a boolean based on whether the given node has relationships (or whether the given nodes has relationships of the given type and direction).

Function

apoc.nodes

Qualified Name Type

apoc.nodes.collapse
Merges nodes together in the given list. The nodes are then combined to become one node, with all labels of the previous nodes attached to it, and all relationships 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 nodes with the given ids.

Procedure

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

Procedure

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 nodes connected by the given relationship type.

Procedure

apoc.nodes.relationship.types
Returns a list of distinct relationship types from the given list of nodes.

Function

apoc.nodes.relationships.exist
Returns a boolean based on whether or not the given nodes have the given relationships.

Function

apoc.nodes.rels
Returns all relationships 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 value of the given large number (using Java BigDecimal).

Function

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

Function

apoc.number.format
Formats the given long or double 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 double.

Function

apoc.number.parseInt
Parses the given string using the given pattern and language to produce a long.

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 paths into one path.

Function

apoc.path.create
Returns a path from the given start node and a list of relationships.

Function

apoc.path.elements
Converts the given path into a list of nodes and relationships.

Function

apoc.path.expand
Returns paths expanded from the start node following the given relationship types from min-depth to max-depth.

Procedure

apoc.path.expandConfig
Returns paths expanded from the start node the given relationship types from min-depth to max-depth.

Procedure

apoc.path.slice
Returns a sub-path of the given length and offset from the given path.

Function

apoc.path.spanningTree
Returns spanning tree paths 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 nodes 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 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 nodes from nodes in the graph with the specified sourceKey as one of its property keys. The new category nodes are then connected to the original nodes with a relationship of the given type.

Procedure

apoc.refactor.cloneNodes
Clones the given nodes with their labels and properties. It is possible to skip any node properties using skipProperties (note: this only skips properties on nodes and not their relationships).

Procedure

apoc.refactor.cloneSubgraph
Clones the given nodes with their labels and properties (optionally skipping any properties in the skipProperties list via the config map), and clones the given relationships. If no relationships are provided, all existing relationships between the given nodes will be cloned.

Procedure

apoc.refactor.cloneSubgraphFromPaths
Clones a sub-graph defined by the given list of paths. It is possible to skip any node properties using the skipProperties list 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 relationships into intermediate nodes. The intermediate nodes are connected by the given 'OUT' and 'IN' types.

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 of nodes onto the first node in the list. All relationships are merged onto that node as well.

Procedure

apoc.refactor.mergeRelationships
Merges the given list of relationships onto the first relationship in the list.

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 nodes. If a list of nodes is provided, the renaming is applied to the nodes within this list only.

Procedure

apoc.refactor.rename.nodeProperty
Renames the given property from 'oldName' to 'newName' for all nodes. If a list of nodes is provided, the renaming is applied to the nodes within this list only.

Procedure

apoc.refactor.rename.type
Renames all relationships with type 'oldType' to 'newType'. If a list of relationships is provided, the renaming is applied to the relationships within this list only.

Procedure

apoc.refactor.rename.typeProperty
Renames the given property from 'oldName' to 'newName' for all relationships. If a list of relationships is provided, the renaming is applied to the relationships within this list 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 integers.

Function

Qualified Name Type

apoc.search.multiSearchReduced
Returns a reduced representation of the nodes found after a parallel search over multiple indexes. The reduced node representation includes: node id, node labels and the searched properties.

Procedure

apoc.search.node
Returns all the distinct nodes found after a parallel search over multiple indexes.

Procedure

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

Procedure

apoc.search.nodeAllReduced
Returns a reduced representation of the nodes found after a parallel search over multiple indexes. The reduced node representation includes: node id, node labels and the searched properties.

Procedure

apoc.search.nodeReduced
Returns a reduced representation of the distinct nodes found after a parallel search over multiple indexes. The reduced node 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 paths by the sum of their distance based on the latitude/longitude values on the nodes.

Procedure

apoc.stats

Qualified Name Type

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 long 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 long value into a string.

Function

apoc.text.compareCleaned
Compares two given strings 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 strings 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 strings.

Function

apoc.text.hammingDistance
compares the two given strings 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 occurences of the lookup string in the given string, or an empty list if not found.

Function

apoc.text.jaroWinklerDistance
compares the two given strings using the Jaro-Winkler distance algorithm.

Function

apoc.text.join
Joins the given strings using the given delimiter.

Function

apoc.text.levenshteinDistance
Compares the given strings using the Levenshtein distance algorithm.

Function

apoc.text.levenshteinSimilarity
Returns the similarity (a value within 0 and 1) between the two given strings 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 strings.

Procedure

apoc.text.random
Generates a random string to the given length using a length parameter and an optional string of valid characters.

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 strings 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. 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.

Function

apoc.util.sha256
Returns the SHA256 of the concatenation of all string values in the given list.

Function

apoc.util.sha384
Returns the SHA384 of the concatenation of all string values in the given list.

Function

apoc.util.sha512
Returns the SHA512 of the concatenation of all string values in the list.

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 nodes and relationships in the database into memory.

Procedure

apoc.xml

Qualified Name Type

apoc.xml.parse
Parses the given XML string as a map.

Function