Procedures & Functions

apoc.agg

Qualified Name Type

apoc.agg.first(value) - returns first value

Function

apoc.agg.graph(path) - returns map of graph {nodes, relationships} of all distinct nodes and relationships

Function

apoc.agg.last(value) - returns last value

Function

apoc.agg.maxItems(item, value, groupLimit: -1) - returns a map {items:[], value:n} where value is the maximum value present, and items are all items with the same value. The number of items can be optionally limited.

Function

apoc.agg.median(number) - returns median for non-null numeric values

Function

apoc.agg.minItems(item, value, groupLimit: -1) - returns a map {items:[], value:n} where value is the minimum value present, and items are all items with the same value. The number of items can be optionally limited.

Function

apoc.agg.nth(value,offset) - returns value of nth row (or -1 for last)

Function

apoc.agg.percentiles(value,[percentiles = 0.5,0.75,0.9,0.95,0.99]) - returns given percentiles for values

Function

apoc.agg.product(number) - returns given product for non-null values

Function

apoc.agg.slice(value, start, length) - returns subset of non-null values, start is 0 based and length can be -1

Function

apoc.agg.statistics(value,[percentiles = 0.5,0.75,0.9,0.95,0.99]) - returns numeric statistics (percentiles, min,minNonZero,max,total,mean,stdev) for values

Function

apoc.algo

Qualified Name Type

apoc.algo.aStar(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance','lat','lon') YIELD path, weight - run A* with relationship property name as cost function

Procedure

apoc.algo.aStar(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', {weight:'dist',default:10,x:'lon',y:'lat'}) YIELD path, weight - run A* with relationship property name as cost function

Procedure

apoc.algo.allSimplePaths(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 5) YIELD path, weight - run allSimplePaths with relationships given and maxNodes

Procedure

apoc.algo.cover(nodes) yield rel - returns all relationships between this set of nodes

Procedure

apoc.algo.dijkstra(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance', defaultValue, numberOfWantedResults) YIELD path, weight - run dijkstra with relationship property name as cost function

Procedure

apoc.algo.dijkstraWithDefaultWeight(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance', 10) YIELD path, weight - run dijkstra with relationship property name as cost function and a default weight if the property does not exist

Procedure

apoc.algo.cosineSimilarity([vector1], [vector2]) given two collection vectors, calculate cosine similarity

Function

apoc.algo.euclideanDistance([vector1], [vector2]) given two collection vectors, calculate the euclidean distance (square root of the sum of the squared differences)

Function

apoc.algo.euclideanSimilarity([vector1], [vector2]) given two collection vectors, calculate similarity based on euclidean distance

Function

apoc.any

Qualified Name Type

returns properties for virtual and real, nodes, rels and maps

Function

returns property for virtual and real, nodes, rels and maps

Function

apoc.atomic

Qualified Name Type

apoc.atomic.add(node/relatonship,propertyName,number) Sums the property’s value with the 'number' value

Procedure

apoc.atomic.concat(node/relatonship,propertyName,string) Concats the property’s value with the 'string' value

Procedure

apoc.atomic.insert(node/relatonship,propertyName,position,value) insert a value into the property’s array value at 'position'

Procedure

apoc.atomic.remove(node/relatonship,propertyName,position) remove the element at position 'position'

Procedure

apoc.atomic.subtract(node/relatonship,propertyName,number) Subtracts the 'number' value to the property’s value

Procedure

apoc.atomic.update(node/relatonship,propertyName,updateOperation) update a property’s value with a cypher operation (ex. "n.prop1+n.prop2")

Procedure

apoc.bitwise

Qualified Name Type

apoc.bitwise.op(60,'|',13) bitwise operations a & b, a | b, a ^ b, ~a, a >> b, a >>> b, a << b. returns the result of the bitwise operation

Function

apoc.bolt

Qualified Name Type

apoc.bolt.execute(url-or-key, kernelTransaction, params, config) - access to other databases via bolt for read

Procedure

apoc.bolt.load(url-or-key, kernelTransaction, params, config) - access to other databases via bolt for read

Procedure

apoc.cluster

Qualified Name Type

Procedure

apoc.coll

Qualified Name Type

apoc.coll.elements(list,limit,offset) yield _1,_2,..,_10,_1s,_2i,_3f,_4m,_5l,_6n,_7r,_8p - deconstruct subset of mixed list into identifiers of the correct type

Procedure

apoc.coll.partition(list,batchSize)

Procedure

apoc.coll.split(list,value) | splits collection on given values rows of lists, value itself will not be part of resulting lists

Procedure

apoc.coll.zipToRows(list1,list2) - creates pairs like zip but emits one row per pair

Procedure

apoc.coll.avg([0.5,1,2.3])

Function

apoc.coll.combinations(coll, minSelect, maxSelect:minSelect) - Returns collection of all combinations of list elements of selection size between minSelect and maxSelect (default:minSelect), inclusive

Function

apoc.coll.contains(coll, value) optimized contains operation (using a HashSet) (returns single row or not)

Function

apoc.coll.containsAll(coll, values) optimized contains-all operation (using a HashSet) (returns single row or not)

Function

apoc.coll.containsAllSorted(coll, value) optimized contains-all on a sorted list operation (Collections.binarySearch) (returns single row or not)

Function

apoc.coll.containsDuplicates(coll) - returns true if a collection contains duplicate elements

Function

apoc.coll.containsSorted(coll, value) optimized contains on a sorted list operation (Collections.binarySearch) (returns single row or not)

Function

apoc.coll.different(values) - returns true if values are different

Function

apoc.coll.disjunction(first, second) - returns the disjunct set of the two lists

Function

apoc.coll.dropDuplicateNeighbors(list) - remove duplicate consecutive objects in a list

Function

apoc.coll.duplicates(coll) - returns a list of duplicate items in the collection

Function

apoc.coll.duplicatesWithCount(coll) - returns a list of duplicate items in the collection and their count, keyed by item and count (e.g., [{item: xyz, count:2}, {item:zyx, count:5}])

Function

apoc.coll.fill(item, count) - returns a list with the given count of items

Function

apoc.coll.flatten(coll, [recursive]) - flattens list (nested if recursive is true)

Function

apoc.coll.frequencies(coll) - returns a list of frequencies of the items in the collection, keyed by item and count (e.g., [{item: xyz, count:2}, {item:zyx, count:5}, {item:abc, count:1}])

Function

apoc.coll.frequenciesAsMap(coll) - return a map of frequencies of the items in the collection, key item, value count (e.g., {1:2, 2:1})

Function

apoc.coll.indexOf(coll, value) | position of value in the list

Function

apoc.coll.insert(coll, index, value) | insert value at index

Function

apoc.coll.insertAll(coll, index, values) | insert values at index

Function

apoc.coll.intersection(first, second) - returns the unique intersection of the two lists

Function

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

Function

apoc.coll.max([0.5,1,2.3])

Function

apoc.coll.min([0.5,1,2.3])

Function

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

Function

apoc.coll.pairs([1,2,3]) returns [1,2],[2,3],[3,null]

Function

apoc.coll.pairsMin([1,2,3]) returns [1,2],[2,3]

Function

apoc.coll.partition(list,batchSize)

Function

apoc.coll.randomItem(coll)- returns a random item from the list, or null on an empty or null list

Function

apoc.coll.randomItems(coll, itemCount, allowRepick: false) - returns a list of itemCount random items from the original list, optionally allowing picked elements to be picked again

Function

apoc.coll.remove(coll, index, [length=1]) | remove range of values from index to length

Function

apoc.coll.removeAll(first, second) - returns first list with all elements of second list removed

Function

apoc.coll.reverse(coll) - returns reversed list

Function

apoc.coll.set(coll, index, value) | set index to value

Function

apoc.coll.shuffle(coll) - returns the shuffled list

Function

apoc.coll.sort(coll) sort on Collections

Function

apoc.coll.sortMaps([maps], 'name') - sort maps by property

Function

apoc.coll.sortMulti(coll, ['^name','age'],[limit],[skip]) - sort list of maps by several sort fields (ascending with ^ prefix) and optionally applies limit and skip

Function

apoc.coll.sortNodes([nodes], 'name') sort nodes by property

Function

apoc.coll.sortText(coll) sort on string based collections

Function

apoc.coll.subtract(first, second) - returns unique set of first list with all elements of second list removed

Function

apoc.coll.sum([0.5,1,2.3])

Function

apoc.coll.sumLongs([1,3,3])

Function

apoc.coll.toSet([list]) returns a unique list backed by a set

Function

apoc.coll.union(first, second) - creates the distinct union of the 2 lists

Function

apoc.coll.unionAll(first, second) - creates the full union with duplicates of the two lists

Function

apoc.coll.zip([list1],[list2])

Function

apoc.config

Qualified Name Type

apoc.config.list | Lists the Neo4j configuration as key,value table

Procedure

apoc.config.map | Lists the Neo4j configuration as map

Procedure

apoc.convert

Qualified Name Type

apoc.convert.setJsonProperty(node,key,complexValue) - sets value serialized to JSON as property with the given name on the node

Procedure

apoc.convert.toTree([paths],[lowerCaseRels=true], [config]) creates a stream of nested documents representing the at least one root of these paths

Procedure

apoc.convert.fromJsonList('[1,2,3]'[,'json-path'])

Function

apoc.convert.fromJsonMap('{"a":42,"b":"foo","c":[1,2,3]}'[,'json-path'])

Function

apoc.convert.getJsonProperty(node,key[,'json-path']) - converts serialized JSON in property back to original object

Function

apoc.convert.getJsonPropertyMap(node,key[,'json-path']) - converts serialized JSON in property back to map

Function

apoc.convert.toBoolean(value) | tries it’s best to convert the value to a boolean

Function

apoc.convert.toBooleanList(value) | tries it’s best to convert the value to a list of booleans

Function

apoc.convert.toFloat(value) | tries it’s best to convert the value to a float

Function

apoc.convert.toIntList(value) | tries it’s best to convert the value to a list of integers

Function

apoc.convert.toInteger(value) | tries it’s best to convert the value to an integer

Function

apoc.convert.toJson([1,2,3]) or toJson({a:42,b:"foo",c:[1,2,3]})

Function

apoc.convert.toList(value) | tries it’s best to convert the value to a list

Function

apoc.convert.toMap(value) | tries it’s best to convert the value to a map

Function

apoc.convert.toNode(value) | tries it’s best to convert the value to a node

Function

apoc.convert.toNodeList(value) | tries it’s best to convert the value to a list of nodes

Function

apoc.convert.toRelationship(value) | tries it’s best to convert the value to a relationship

Function

apoc.convert.toRelationshipList(value) | tries it’s best to convert the value to a list of relationships

Function

apoc.convert.toSet(value) | tries it’s best to convert the value to a set

Function

apoc.convert.toSortedJsonMap(node|map, ignoreCase:true) - returns a JSON map with keys sorted alphabetically, with optional case sensitivity

Function

apoc.convert.toString(value) | tries it’s best to convert the value to a string

Function

apoc.convert.toStringList(value) | tries it’s best to convert the value to a list of strings

Function

apoc.couchbase

Qualified Name Type

apoc.couchbase.append(hostOrKey, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - append a couchbase json document to an existing one.

Procedure

apoc.couchbase.exists(hostOrKey, bucket, documentId) yield value - check whether a couchbase json document with the given ID does exist.

Procedure

apoc.couchbase.get(hostOrKey, bucket, documentId) yield id, expiry, cas, mutationToken, content - retrieves a couchbase json document by its unique ID.

Procedure

apoc.couchbase.insert(hostOrKey, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - insert a couchbase json document with its unique ID.

Procedure

apoc.couchbase.namedParamsQuery(hostkOrKey, bucket, statement, paramNames, paramValues) yield queryResult - executes a N1QL statement with named parameters.

Procedure

apoc.couchbase.posParamsQuery(hostOrKey, bucket, statement, params) yield queryResult - executes a N1QL statement with positional parameters.

Procedure

apoc.couchbase.prepend(hostOrKey, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - prepend a couchbase json document to an existing one.

Procedure

apoc.couchbase.query(hostOrKey, bucket, statement) yield queryResult - executes a plain un-parameterized N1QL statement.

Procedure

apoc.couchbase.remove(hostOrKey, bucket, documentId) yield id, expiry, cas, mutationToken, content - remove the couchbase json document identified by its unique ID.

Procedure

apoc.couchbase.replace(hostOrKey, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - replace the content of the couchbase json document identified by its unique ID.

Procedure

apoc.couchbase.upsert(hostOrKey, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - insert or overwrite a couchbase json document with its unique ID.

Procedure

apoc.create

Qualified Name Type

apoc.create.addLabels( [node,id,ids,nodes], ['Label',…​]) - adds the given labels to the node or nodes

Procedure

apoc.create.node(['Label'], {key:value,…​}) - create node with dynamic labels

Procedure

apoc.create.nodes(['Label'], [{key:value,…​}]) create multiple nodes with dynamic labels

Procedure

apoc.create.relationship(person1,'KNOWS',{key:value,…​}, person2) create relationship with dynamic rel-type

Procedure

apoc.create.removeLabels( [node,id,ids,nodes], ['Label',…​]) - removes the given labels from the node or nodes

Procedure

apoc.create.removeProperties( [node,id,ids,nodes], [keys]) - removes the given properties from the nodes(s)

Procedure

apoc.create.removeRelProperties( [rel,id,ids,rels], [keys]) - removes the given properties from the relationship(s)

Procedure

apoc.create.setLabels( [node,id,ids,nodes], ['Label',…​]) - sets the given labels, non matching labels are removed on the node or nodes

Procedure

apoc.create.setProperties( [node,id,ids,nodes], [keys], [values]) - sets the given properties on the nodes(s)

Procedure

apoc.create.setProperty( [node,id,ids,nodes], key, value) - sets the given property on the node(s)

Procedure

apoc.create.setRelProperties( [rel,id,ids,rels], [keys], [values]) - sets the given properties on the relationship(s)

Procedure

apoc.create.setRelProperty( [rel,id,ids,rels], key, value) - sets the given property on the relationship(s)

Procedure

apoc.create.uuids(count) yield uuid - creates 'count' UUIDs

Procedure

apoc.create.vNode(['Label'], {key:value,…​}) returns a virtual node

Procedure

apoc.create.vNodes(['Label'], [{key:value,…​}]) returns virtual nodes

Procedure

apoc.create.vPattern({_labels:['LabelA'],key:value},'KNOWS',{key:value,…​}, {_labels:['LabelB'],key:value}) returns a virtual pattern

Procedure

apoc.create.vPatternFull(['LabelA'],{key:value},'KNOWS',{key:value,…​},['LabelB'],{key:value}) returns a virtual pattern

Procedure

apoc.create.vRelationship(nodeFrom,'KNOWS',{key:value,…​}, nodeTo) returns a virtual relationship

Procedure

apoc.create.uuid() - creates an UUID

Function

apoc.create.vNode(['Label'], {key:value,…​}) returns a virtual node

Function

apoc.create.vRelationship(nodeFrom,'KNOWS',{key:value,…​}, nodeTo) returns a virtual relationship

Function

apoc.custom

Qualified Name Type

apoc.custom.asFunction(name, statement, outputs, inputs, forceSingle, description) - register a custom cypher function

Procedure

apoc.custom.asProcedure(name, statement, mode, outputs, inputs, description) - register a custom cypher procedure

Procedure

apoc.custom.declareFunction(signature, statement, forceSingle, description) - register a custom cypher function

Procedure

apoc.custom.declareProcedure(signature, statement, mode, description) - register a custom cypher procedure

Procedure

apoc.custom.list() - provide a list of custom procedures/function registered

Procedure

apoc.custom.removeFunction(name, type) - remove the targeted custom function

Procedure

apoc.custom.removeProcedure(name) - remove the targeted custom procedure

Procedure

apoc.cypher

Qualified Name Type

apoc.cypher.doIt(fragment, params) yield value - executes writing fragment with the given parameters

Procedure

apoc.cypher.mapParallel(fragment, params, list-to-parallelize) yield value - executes fragment in parallel batches with the list segments being assigned to _

Procedure

apoc.cypher.mapParallel2(fragment, params, list-to-parallelize) yield value - executes fragment in parallel batches with the list segments being assigned to _

Procedure

Procedure

Procedure

apoc.cypher.run(fragment, params) yield value - executes reading fragment with the given parameters

Procedure

apoc.cypher.runFile(file or url,[{statistics:true,timeout:10,parameters:{}}]) - runs each statement in the file, all semicolon separated - currently no schema operations

Procedure

apoc.cypher.runFiles([files or urls],[{statistics:true,timeout:10,parameters:{}}])) - runs each statement in the files, all semicolon separated

Procedure

apoc.cypher.runMany('cypher;\nstatements;',{params},[{statistics:true,timeout:10}]) - runs each semicolon separated statement and returns summary - currently no schema operations

Procedure

apoc.cypher.runSchemaFile(file or url,[{statistics:true,timeout:10}]) - allows only schema operations, runs each schema statement in the file, all semicolon separated

Procedure

apoc.cypher.runSchemaFiles([files or urls],{statistics:true,timeout:10}) - allows only schema operations, runs each schema statement in the files, all semicolon separated

Procedure

apoc.cypher.runTimeboxed('cypherStatement',{params}, timeout) - abort kernelTransaction after timeout ms if not finished

Procedure

use either apoc.cypher.runFirstColumnMany for a list return or apoc.cypher.runFirstColumnSingle for returning the first row of the first column

Function

apoc.cypher.runFirstColumnMany(statement, params) - executes statement with given parameters, returns first column only collected into a list, params are available as identifiers

Function

apoc.cypher.runFirstColumnSingle(statement, params) - executes statement with given parameters, returns first element of the first column only, params are available as identifiers

Function

apoc.data

Qualified Name Type

apoc.data.domain('url_or_email_address') YIELD domain - extract the domain name from a url or an email address. If nothing was found, yield null.

Function

apoc.data.email('email_address') as {personal,user,domain} - extract the personal name, user and domain as a map

Function

apoc.data.url('url') as {protocol,host,port,path,query,file,anchor,user} | turn URL into map structure

Function

apoc.date

Qualified Name Type

CALL apoc.date.expire(node,time,'time-unit') - expire node at specified time by setting :TTL label and ttl property

Procedure

CALL apoc.date.expire.in(node,time,'time-unit') - expire node after specified length of time time by setting :TTL label and ttl property

Procedure

apoc.date.add(12345, 'ms', -365, 'd') given a timestamp in one time unit, adds a value of the specified time unit

Function

apoc.date.convert(12345, 'ms', 'd') convert a timestamp in one time unit into one of a different time unit

Function

apoc.date.convertFormat('Tue, 14 May 2019 14:52:06 -0400', 'rfc_1123_date_time', 'iso_date_time') convert a String of one date format into a String of another date format.

Function

apoc.date.currentTimestamp() - returns System.currentTimeMillis()

Function

apoc.date.field(12345,('ms|s|m|h|d|month|year'),('TZ')

Function

apoc.date.fields('2012-12-23',('yyyy-MM-dd')) - return columns and a map representation of date parsed with the given format with entries for years,months,weekdays,days,hours,minutes,seconds,zoneid

Function

apoc.date.format(12345,('ms|s|m|h|d'),('yyyy-MM-dd HH:mm:ss zzz'),('TZ')) get string representation of time value optionally using the specified unit (default ms) using specified format (default ISO) and specified time zone (default current TZ)

Function

apoc.date.fromISO8601('yyyy-MM-ddTHH:mm:ss.SSSZ') return number representation of time in EPOCH format

Function

apoc.date.parse('2012-12-23','ms|s|m|h|d','yyyy-MM-dd') parse date string using the specified format into the specified time unit

Function

apoc.date.parseAsZonedDateTime('2012-12-23 23:59:59','yyyy-MM-dd HH:mm:ss', 'UTC-hour-offset') parse date string using the specified format to specified timezone

Function

apoc.date.systemTimezone() returns the system timezone display name

Function

apoc.date.toISO8601(12345,('ms|s|m|h|d') return string representation of time in ISO8601 format

Function

toYears(timestamp) or toYears(date[,format]) converts timestamp into floating point years

Function

apoc.diff

Qualified Name Type

Function

apoc.do

Qualified Name Type

apoc.do.case([condition, query, condition, query, …​], elseQuery:'', params:{}) yield value - given a list of conditional / writing query pairs, executes the query associated with the first conditional evaluating to true (or the else query if none are true) with the given parameters

Procedure

apoc.do.when(condition, ifQuery, elseQuery:'', params:{}) yield value - based on the conditional, executes writing ifQuery or elseQuery with the given parameters

Procedure

apoc.es

Qualified Name Type

apoc.es.get(host-or-port,index-or-null,type-or-null,id-or-null,query-or-null,payload-or-null) yield value - perform a GET operation on elastic search

Procedure

apoc.es.getRaw(host-or-port,path,payload-or-null) yield value - perform a raw GET operation on elastic search

Procedure

apoc.es.post(host-or-port,index-or-null,type-or-null,query-or-null,payload-or-null) yield value - perform a POST operation on elastic search

Procedure

apoc.es.postRaw(host-or-port,path,payload-or-null) yield value - perform a raw POST operation on elastic search

Procedure

apoc.es.put(host-or-port,index-or-null,type-or-null,id-or-null,query-or-null,payload-or-null) yield value - perform a PUT operation on elastic search

Procedure

apoc.es.query(host-or-port,index-or-null,type-or-null,query-or-null,payload-or-null) yield value - perform a SEARCH operation on elastic search

Procedure

apoc.es.stats(host-url-Key) - elastic search statistics

Procedure

apoc.example

Qualified Name Type

apoc.example.movies() | Creates the sample movies graph

Procedure

apoc.export

Qualified Name Type

apoc.export.cypherAll(file,config) - exports whole database incl. indexes as cypher statements to the provided file

Procedure

apoc.export.cypherData(nodes,rels,file,config) - exports given nodes and relationships incl. indexes as cypher statements to the provided file

Procedure

apoc.export.cypherGraph(graph,file,config) - exports given graph object incl. indexes as cypher statements to the provided file

Procedure

apoc.export.cypherQuery(query,file,config) - exports nodes and relationships from the cypher kernelTransaction incl. indexes as cypher statements to the provided file

Procedure

apoc.generate

Qualified Name Type

apoc.generate.ba(noNodes, edgesPerNode, label, type) - generates a random graph according to the Barabasi-Albert model

Procedure

apoc.generate.complete(noNodes, label, type) - generates a random complete graph

Procedure

apoc.generate.er(noNodes, noEdges, label, type) - generates a random graph according to the Erdos-Renyi model

Procedure

apoc.generate.simple(degrees, label, type) - generates a simple random graph according to the given degree distribution

Procedure

apoc.generate.ws(noNodes, degree, beta, label, type) - generates a random graph according to the Watts-Strogatz model

Procedure

apoc.gephi

Qualified Name Type

apoc.gephi.add(url-or-key, workspace, data, weightproperty, ['exportproperty']) | streams passed in data to Gephi

Procedure

apoc.get

Qualified Name Type

apoc.get.nodes(node|id|[ids]) - quickly returns all nodes with these id’s

Procedure

apoc.get.rels(rel|id|[ids]) - quickly returns all relationships with these id’s

Procedure

apoc.graph

Qualified Name Type

apoc.graph.from(data,'name',{properties}) | creates a virtual graph object for later processing it tries its best to extract the graph information from the data you pass in

Procedure

apoc.graph.fromCypher('kernelTransaction',{params},'name',{properties}) - creates a virtual graph object for later processing

Procedure

apoc.graph.fromDB('name',{properties}) - creates a virtual graph object for later processing

Procedure

apoc.graph.fromData([nodes],[relationships],'name',{properties}) | creates a virtual graph object for later processing

Procedure

apoc.graph.fromDocument({json}, {config}) yield graph - transform JSON documents into graph structures

Procedure

apoc.graph.fromPaths(path,'name',{properties}) - creates a virtual graph object for later processing

Procedure

apoc.graph.fromPaths([paths],'name',{properties}) - creates a virtual graph object for later processing

Procedure

apoc.graph.validateDocument({json}, {config}) yield row - validates the json, return the result of the validation

Procedure

apoc.hashing

Qualified Name Type

calculate a checksum (md5) over a node or a relationship. This deals gracefully with array properties. Two identical entities do share the same hash.

Function

calculate a checksum (md5) over a the full graph. Be aware that this function does use in-memomry datastructures depending on the size of your graph.

Function

calculate a checksum (md5) over a node or a relationship. This deals gracefully with array properties. Two identical entities do share the same hash.

Function

apoc.import

Qualified Name Type

apoc.import.csv(nodes, relationships, config) - imports nodes and relationships from the provided CSV files with given labels and types

Procedure

apoc.import.graphml(file,config) - imports graphml file

Procedure

apoc.import.json(file,config) - imports the json list to the provided file

Procedure

apoc.import.xml(file,config) - imports graph from provided file

Procedure

apoc.json

Qualified Name Type

apoc.json.path('{json}','json-path')

Function

apoc.label

Qualified Name Type

apoc.label.exists(element, label) - returns true or false related to label existance

Function

apoc.load

Qualified Name Type

apoc.load.csv('url',{config}) YIELD lineNo, list, map - load CSV fom URL as stream of values, config contains any of: {skip:1,limit:5,header:false,sep:'TAB',ignore:['tmp'],nullValues:['na'],arraySep:';',mapping:{years:{type:'int',arraySep:'-',array:false,name:'age',ignore:false}}

Procedure

apoc.load.driver('org.apache.derby.jdbc.EmbeddedDriver') register JDBC driver of source database

Procedure

apoc.load.html('url',{name: jquery, name2: jquery}, config) YIELD value - Load Html page and return the result as a Map

Procedure

apoc.load.jdbc('key or url','table or statement', params, config) YIELD row - load from relational database, from a full table or a sql statement

Procedure

deprecated - please use: apoc.load.jdbc('key or url','',[params]) YIELD row - load from relational database, from a sql statement with parameters

Procedure

apoc.load.jdbcUpdate('key or url','statement',[params],config) YIELD row - update relational database, from a SQL statement with optional parameters

Procedure

apoc.load.json('url',path, config) YIELD value - import JSON as stream of values if the JSON was an array or a single value if it was a map

Procedure

apoc.load.jsonArray('url') YIELD value - load array from JSON URL (e.g. web-api) to import JSON as stream of values

Procedure

apoc.load.jsonParams('url',{header:value},payload, config) YIELD value - load from JSON URL (e.g. web-api) while sending headers / payload to import JSON as stream of values if the JSON was an array or a single value if it was a map

Procedure

apoc.load.ldap("key" or {connectionMap},{searchMap}) Load entries from an ldap source (yield entry)

Procedure

apoc.load.xls('url','selector',{config}) YIELD lineNo, list, map - load XLS fom URL as stream of row values, config contains any of: {skip:1,limit:5,header:false,ignore:['tmp'],arraySep:';',mapping:{years:{type:'int',arraySep:'-',array:false,name:'age',ignore:false, dateFormat:'iso_date', dateParse:['dd-MM-yyyy']}}

Procedure

apoc.load.xml('http://example.com/test.xml', 'xPath',config, false) YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _childrenx fields.

Procedure

apoc.load.xmlSimple('http://example.com/test.xml') YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _children fields. This method does intentionally not work with XML mixed content.

Procedure

apoc.lock

Qualified Name Type

apoc.lock.all([nodes],[relationships]) acquires a write lock on the given nodes and relationships

Procedure

apoc.lock.nodes([nodes]) acquires a write lock on the given nodes

Procedure

apoc.lock.rels([relationships]) acquires a write lock on the given relationship

Procedure

apoc.log

Qualified Name Type

apoc.log.debug(message, params) - logs debug message

Procedure

apoc.log.error(message, params) - logs error message

Procedure

apoc.log.info(message, params) - logs info message

Procedure

apoc.log.stream('neo4j.log', { last: n }) - retrieve log file contents, optionally return only the last n lines

Procedure

apoc.log.warn(message, params) - logs warn message

Procedure

apoc.map

Qualified Name Type

apoc.map.clean(map,[skip,keys],[skip,values]) yield map filters the keys and values contained in those lists, good for data cleaning from CSV/JSON

Function

apoc.map.flatten(map, delimiter:'.') yield map - flattens nested items in map using dot notation

Function

apoc.map.fromLists([keys],[values])

Function

apoc.map.fromNodes(label, property)

Function

apoc.map.fromPairs([[key,value],[key2,value2],…​])

Function

apoc.map.fromValues([key1,value1,key2,value2,…​])

Function

apoc.map.get(map,key,[default],[fail=true]) - returns value for key or throws exception if key doesn’t exist and no default given

Function

apoc.map.groupBy([maps/nodes/relationships],'key') yield value - creates a map of the list keyed by the given property, with single values

Function

apoc.map.groupByMulti([maps/nodes/relationships],'key') yield value - creates a map of the list keyed by the given property, with list values

Function

apoc.map.merge(first,second) - merges two maps

Function

apoc.map.mergeList([{maps}]) yield value - merges all maps in the list into one

Function

apoc.map.mget(map,key,[defaults],[fail=true]) - returns list of values for keys or throws exception if one of the key doesn’t exist and no default value given at that position

Function

apoc.map.removeKey(map,key,{recursive:true/false}) - remove the key from the map (recursively if recursive is true)

Function

apoc.map.removeKeys(map,[keys],{recursive:true/false}) - remove the keys from the map (recursively if recursive is true)

Function

apoc.map.setEntry(map,key,value)

Function

apoc.map.setKey(map,key,value)

Function

apoc.map.setLists(map,[keys],[values])

Function

apoc.map.setPairs(map,[[key1,value1],[key2,value2])

Function

apoc.map.setValues(map,[key1,value1,key2,value2])

Function

apoc.map.sortedProperties(map, ignoreCase:true) - returns a list of key/value list pairs, with pairs sorted by keys alphabetically, with optional case sensitivity

Function

apoc.map.submap(map,keys,[defaults],[fail=true]) - returns submap for keys or throws exception if one of the key doesn’t exist and no default value given at that position

Function

apoc.map.updateTree(tree,key,) returns map - adds the {data} map on each level of the nested tree, where the key-value pairs match

Function

apoc.map.values(map, [key1,key2,key3,…​],[addNullsForMissing]) returns list of values indicated by the keys

Function

apoc.math

Qualified Name Type

apoc.math.regr(label, propertyY, propertyX) - It calculates the coefficient of determination (R-squared) for the values of propertyY and propertyX in the provided label

Procedure

apoc.math.maxByte() | return the maximum value an byte can have

Function

apoc.math.maxDouble() | return the largest positive finite value of type double

Function

apoc.math.maxInt() | return the maximum value an int can have

Function

apoc.math.maxLong() | return the maximum value a long can have

Function

apoc.math.minByte() | return the minimum value an byte can have

Function

apoc.math.minDouble() | return the smallest positive nonzero value of type double

Function

apoc.math.minInt() | return the minimum value an int can have

Function

apoc.math.minLong() | return the minimum value a long can have

Function

apoc.math.round(value,[prec],mode=[CEILING,FLOOR,UP,DOWN,HALF_EVEN,HALF_DOWN,HALF_UP,DOWN,UNNECESSARY])

Function

apoc.merge

Qualified Name Type

"apoc.merge.node.eager(['Label'], identProps:{key:value, …​}, onCreateProps:{key:value,…​}, onMatchProps:{key:value,…​}}) - merge nodes with dynamic labels, with support for setting properties ON CREATE or ON MATCH

Procedure

apoc.merge.relationship(startNode, relType, identProps:{key:value, …​}, onCreateProps:{key:value, …​}, endNode, onMatchProps:{key:value, …​}) - merge relationship with dynamic type, with support for setting properties ON CREATE or ON MATCH

Procedure

apoc.meta

Qualified Name Type

apoc.meta.data({config}) - examines a subset of the graph to provide a tabular meta information

Procedure

apoc.meta.graph - examines the full graph to create the meta-graph

Procedure

apoc.meta.graphSample() - examines the database statistics to build the meta graph, very fast, might report extra relationships

Procedure

apoc.meta.nodeTypeProperties()

Procedure

apoc.meta.relTypeProperties()

Procedure

apoc.meta.schema({config}) - examines a subset of the graph to provide a map-like meta information

Procedure

apoc.meta.stats yield labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount, labels, relTypes, stats | returns the information stored in the transactional database statistics

Procedure

apoc.meta.subGraph({labels:[labels],rels:[rel-types], excludes:[labels,rel-types]}) - examines a sample sub graph to create the meta-graph

Procedure

apoc.meta.isType(value,type) - returns a row if type name matches none if not (INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,UNKNOWN,MAP,LIST)

Function

apoc.meta.type(value) - type name of a value (INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,UNKNOWN,MAP,LIST)

Function

apoc.meta.typeName(value) - type name of a value (INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,UNKNOWN,MAP,LIST)

Function

apoc.meta.types(node-relationship-map) - returns a map of keys to types

Function

apoc.metrics

Qualified Name Type

apoc.metrics.get(metricName, {}) - retrieve a system metric by its metric name. Additional configuration options may be passed matching the options available for apoc.load.csv.

Procedure

apoc.metrics.list() - get a list of available metrics

Procedure

apoc.metrics.storage(directorySetting) - retrieve storage metrics about the devices Neo4j uses for data storage. directorySetting may be any valid neo4j directory setting name, such as 'dbms.directories.data'. If null is provided as a directorySetting, you will get back all available directory settings. For a list of available directory settings, see the Neo4j operations manual reference on configuration settings. Directory settings are not paths, they are a neo4j.conf setting key name

Procedure

apoc.model

Qualified Name Type

apoc.model.jdbc('key or url', {schema:'<schema>', write: <true/false>, filters: { tables:[], views: [], columns: []}) YIELD nodes, relationships - load schema from relational database

Procedure

apoc.mongodb

Qualified Name Type

apoc.mongodb.count(host-or-key,db,collection,query) yield value - perform a find operation on mongodb collection

Procedure

apoc.mongodb.delete(host-or-key,db,collection,query) - delete the given documents from the mongodb collection and returns the number of affected documents

Procedure

apoc.mongodb.find(host-or-key,db,collection,query,projection,sort,[compatibleValues=false|true],skip-or-null,limit-or-null,[extractReferences=false|true],[objectIdAsMap=true|false]) yield value - perform a find,project,sort operation on mongodb collection

Procedure

apoc.mongodb.first(host-or-key,db,collection,query,[compatibleValues=false|true],[extractReferences=false|true],[objectIdAsMap=true|false]) yield value - perform a first operation on mongodb collection

Procedure

apoc.mongodb.get(host-or-key,db,collection,query,[compatibleValues=false|true],skip-or-null,limit-or-null,[extractReferences=false|true],[objectIdAsMap=true|false]) yield value - perform a find operation on mongodb collection

Procedure

apoc.mongodb.insert(host-or-key,db,collection,documents) - inserts the given documents into the mongodb collection

Procedure

apoc.mongodb.update(host-or-key,db,collection,query,update) - updates the given documents from the mongodb collection and returns the number of affected documents

Procedure

apoc.monitor

Qualified Name Type

apoc.monitor.ids() returns the object ids in use for this neo4j instance

Procedure

apoc.monitor.kernel() returns informations about the neo4j kernel

Procedure

apoc.monitor.store() returns informations about the sizes of the different parts of the neo4j graph store

Procedure

apoc.monitor.tx() returns informations about the neo4j transaction manager

Procedure

apoc.neighbors

Qualified Name Type

apoc.neighbors.athop(node, rel-direction-pattern, distance) - returns distinct nodes of the given relationships in the pattern at a distance, can use '>' or '<' for all outgoing or incoming relationships

Procedure

apoc.neighbors.byhop(node, rel-direction-pattern, distance) - returns distinct nodes of the given relationships in the pattern at each distance, can use '>' or '<' for all outgoing or incoming relationships

Procedure

apoc.neighbors.tohop(node, rel-direction-pattern, distance) - returns distinct nodes of the given relationships in the pattern up to a certain distance, can use '>' or '<' for all outgoing or incoming relationships

Procedure

apoc.node

Qualified Name Type

apoc.node.degree(node, rel-direction-pattern) - returns total degrees of the given relationships in the pattern, can use '>' or '<' for all outgoing or incoming relationships

Function

returns id for (virtual) nodes

Function

returns labels for (virtual) nodes

Function

apoc.nodes

Qualified Name Type

apoc.nodes.collapse([nodes…​],[{properties:'overwrite' or 'discard' or 'combine'}]) yield from, rel, to merge nodes onto first in list

Procedure

apoc.nodes.delete(node|nodes|id|[ids]) - quickly delete all nodes with these ids

Procedure

apoc.nodes.get(node|nodes|id|[ids]) - quickly returns all nodes with these ids

Procedure

Procedure

apoc.nodes.link([nodes],'REL_TYPE') - creates a linked list of nodes from first to last

Procedure

apoc.get.rels(rel|id|[ids]) - quickly returns all relationships with these ids

Procedure

apoc.nodes.connected(start, end, rel-direction-pattern) - returns true when the node is connected to the other node, optimized for dense nodes

Function

apoc.nodes.isDense(node) - returns true if it is a dense node

Function

apoc.number

Qualified Name Type

apoc.number.arabicToRoman(number) | convert arabic numbers to roman

Function

apoc.number.format(number) | format a long or double using the default system pattern and language to produce a string

Function

apoc.number.parseFloat(text) | parse a text using the default system pattern and language to produce a double

Function

apoc.number.parseInt(text) | parse a text using the default system pattern and language to produce a long

Function

apoc.number.romanToArabic(romanNumber) | convert roman numbers to arabic

Function

apoc.path

Qualified Name Type

apoc.path.expand(startNode <id>|Node|list, 'TYPE|TYPE_OUT>|<TYPE_IN', '+YesLabel|-NoLabel', minLevel, maxLevel ) yield path - expand from start node following the given relationships from min to max-level adhering to the label filters

Procedure

apoc.path.expandConfig(startNode <id>|Node|list, {minLevel,maxLevel,uniqueness,relationshipFilter,labelFilter,uniqueness:'RELATIONSHIP_PATH',bfs:true, filterStartNode:false, limit:-1, optional:false, endNodes:[], terminatorNodes:[], sequence, beginSequenceAtStart:true}) yield path - expand from start node following the given relationships from min to max-level adhering to the label filters.

Procedure

apoc.path.spanningTree(startNode <id>|Node|list, {maxLevel,relationshipFilter,labelFilter,bfs:true, filterStartNode:false, limit:-1, optional:false, endNodes:[], terminatorNodes:[], sequence, beginSequenceAtStart:true}) yield path - expand a spanning tree reachable from start node following relationships to max-level adhering to the label filters

Procedure

apoc.path.subgraphAll(startNode <id>|Node|list, {maxLevel,relationshipFilter,labelFilter,bfs:true, filterStartNode:false, limit:-1, endNodes:[], terminatorNodes:[], sequence, beginSequenceAtStart:true}) yield nodes, relationships - expand the subgraph reachable from start node following relationships to max-level adhering to the label filters, and also return all relationships within the subgraph

Procedure

apoc.path.subgraphNodes(startNode <id>|Node|list, {maxLevel,relationshipFilter,labelFilter,bfs:true, filterStartNode:false, limit:-1, optional:false, endNodes:[], terminatorNodes:[], sequence, beginSequenceAtStart:true}) yield node - expand the subgraph nodes reachable from start node following relationships to max-level adhering to the label filters

Procedure

apoc.path.combine(path1, path2) - combines the paths into one if the connecting node matches

Function

apoc.path.create(startNode,[rels]) - creates a path instance of the given elements

Function

apoc.path.elements(path) - returns a list of node-relationship-node-…​

Function

apoc.path.slice(path, [offset], [length]) - creates a sub-path with the given offset and length

Function

apoc.periodic

Qualified Name Type

apoc.periodic.cancel(name) - cancel job with the given name

Procedure

apoc.periodic.commit(statement,params) - runs the given statement in separate transactions until it returns 0

Procedure

apoc.periodic.countdown('name',statement,repeat-rate-in-seconds) submit a repeatedly-called background statement until it returns 0

Procedure

apoc.periodic.iterate('statement returning items', 'statement per item', {batchSize:1000,iterateList:true,parallel:false,params:{},concurrency:50,retries:0}) YIELD batches, total - run the second statement for each item returned by the first statement. Returns number of batches and total processed rows

Procedure

apoc.periodic.list - list all jobs

Procedure

apoc.periodic.repeat('name',statement,repeat-rate-in-seconds, config) submit a repeatedly-called background statement. Fourth parameter 'config' is optional and can contain 'params' entry for nested statement.

Procedure

apoc.periodic.rock_n_roll('some cypher for iteration', 'some cypher as action on each iteration', 10000) YIELD batches, total - run the action statement in batches over the iterator statement’s results in a separate thread. Returns number of batches and total processed rows

Procedure

apoc.periodic.rock_n_roll_while('some cypher for knowing when to stop', 'some cypher for iteration', 'some cypher as action on each iteration', 10000) YIELD batches, total - run the action statement in batches over the iterator statement’s results in a separate thread. Returns number of batches and total processed rows

Procedure

apoc.periodic.submit('name',statement) - submit a one-off background statement

Procedure

apoc.refactor

Qualified Name Type

apoc.refactor.categorize(sourceKey, type, outgoing, label, targetKey, copiedKeys, batchSize) turn each unique propertyKey into a category node and connect to it

Procedure

apoc.refactor.cloneNodes([node1,node2,…​]) clone nodes with their labels and properties

Procedure

apoc.refactor.cloneNodesWithRelationships([node1,node2,…​]) clone nodes with their labels, properties and relationships

Procedure

apoc.refactor.cloneSubgraph([node1,node2,…​], [rel1,rel2,…​]:[], {standinNodes:[], skipProperties:[]}) YIELD input, output, error | clone nodes with their labels and properties (optionally skipping any properties in the skipProperties list via the config map), and clone the given relationships (will exist between cloned nodes only). If no relationships are provided, all relationships between the given nodes will be cloned. Relationships can be optionally redirected according to standinNodes node pairings (this is a list of list-pairs of nodes), so given a node in the original subgraph (first of the pair), an existing node (second of the pair) can act as a standin for it within the cloned subgraph. Cloned relationships will be redirected to the standin.

Procedure

apoc.refactor.cloneSubgraphFromPaths([path1, path2, …​], {standinNodes:[], skipProperties:[]}) YIELD input, output, error | from the subgraph formed from the given paths, clone nodes with their labels and properties (optionally skipping any properties in the skipProperties list via the config map), and clone the relationships (will exist between cloned nodes only). Relationships can be optionally redirected according to standinNodes node pairings (this is a list of list-pairs of nodes), so given a node in the original subgraph (first of the pair), an existing node (second of the pair) can act as a standin for it within the cloned subgraph. Cloned relationships will be redirected to the standin.

Procedure

apoc.refactor.collapseNode([node1,node2],'TYPE') collapse node to relationship, node with one rel becomes self-relationship

Procedure

apoc.refactor.extractNode([rel1,rel2,…​], [labels],'OUT','IN') extract node from relationships

Procedure

apoc.refactor.from(rel, startNode) redirect relationship to use new start-node

Procedure

apoc.refactor.invert(rel) inverts relationship direction

Procedure

apoc.refactor.mergeNodes([node1,node2],[{properties:'overwrite' or 'discard' or 'combine'}]) merge nodes onto first in list

Procedure

apoc.refactor.mergeRelationships([rel1,rel2]) merge relationships onto first in list

Procedure

apoc.refactor.normalizeAsBoolean(entity, propertyKey, true_values, false_values) normalize/convert a property to be boolean

Procedure

apoc.refactor.setType(rel, 'NEW-TYPE') change relationship-type

Procedure

apoc.refactor.to(rel, endNode) redirect relationship to use new end-node

Procedure

apoc.rel

Qualified Name Type

returns id for (virtual) relationships

Function

returns type for (virtual) relationships

Function

apoc.schema

Qualified Name Type

apoc.schema.assert({indexLabel:, …​}, {constraintLabel:[constraintKeys], …​}, dropExisting : true) yield label, key, keys, unique, action - drops all other existing indexes and constraints when dropExisting is true (default is true), and asserts that at the end of the operation the given indexes and unique constraints are there, each label:key pair is considered one constraint/label. Non-constraint indexes can define compound indexes with label:[key1,key2…​] pairings.

Procedure

CALL apoc.schema.nodes([config]) yield name, label, properties, status, type

Procedure

CALL apoc.schema.relationships([config]) yield name, startLabel, type, endLabel, properties, status

Procedure

apoc.scoring

Qualified Name Type

apoc.scoring.existence(5, true) returns the provided score if true, 0 if false

Function

apoc.scoring.pareto(10, 20, 100, 11) applies a Pareto scoring function over the inputs

Function

Qualified Name Type

Do a parallel search over multiple indexes returning a reduced representation of the nodes found: node id, labels and the searched properties. apoc.search.multiSearchReduced( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ). Multiple search results for the same node are merged into one record.

Procedure

Do a parallel search over multiple indexes returning nodes. usage apoc.search.node( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ) returns all the DISTINCT Nodes found in the different searches.

Procedure

Do a parallel search over multiple indexes returning nodes. usage apoc.search.nodeAll( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ) returns all the Nodes found in the different searches.

Procedure

Do a parallel search over multiple indexes returning a reduced representation of the nodes found: node id, labels and the searched property. apoc.search.nodeShortAll( map of label and properties which will be searched upon, operator: EXACT / CONTAINS / STARTS WITH | ENDS WITH / = / <> / < / > …​, value ). All 'hits' are returned.

Procedure

Do a parallel search over multiple indexes returning a reduced representation of the nodes found: node id, labels and the searched properties. apoc.search.nodeReduced( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ). Multiple search results for the same node are merged into one record.

Procedure

apoc.spatial

Qualified Name Type

apoc.spatial.geocode('address') YIELD location, latitude, longitude, description, osmData - look up geographic location of address from a geocoding service (the default one is OpenStreetMap)

Procedure

apoc.spatial.geocodeOnce('address') YIELD location, latitude, longitude, description, osmData - look up geographic location of address from a geocoding service (the default one is OpenStreetMap)

Procedure

apoc.spatial.reverseGeocode(latitude,longitude) YIELD location, latitude, longitude, description - look up address from latitude and longitude from a geocoding service (the default one is OpenStreetMap)

Procedure

apoc.spatial.sortPathsByDistance(List<Path>) sort the given paths based on the geo informations (lat/long) in ascending order

Procedure

apoc.static

Qualified Name Type

apoc.static.get(name) - returns statically stored value from config (apoc.static.<key>) or server lifetime storage

Procedure

apoc.static.list(prefix) - returns statically stored values from config (apoc.static.<prefix>.*) or server lifetime storage

Procedure

apoc.static.set(name, value) - stores value under key for server lifetime storage, returns previously stored or configured value

Procedure

apoc.static.get(name) - returns statically stored value from config (apoc.static.<key>) or server lifetime storage

Function

apoc.static.getAll(prefix) - returns statically stored values from config (apoc.static.<prefix>.*) or server lifetime storage

Function

apoc.stats

Qualified Name Type

Procedure

apoc.systemdb

Qualified Name Type

Procedure

Procedure

apoc.temporal

Qualified Name Type

apoc.temporal.format(input, format) | Format a temporal value

Function

apoc.temporal.formatDuration(input, format) | Format a Duration

Function

apoc.temporal.toZonedTemporal('2012-12-23 23:59:59','yyyy-MM-dd HH:mm:ss', 'UTC-hour-offset') parse date string using the specified format to specified timezone

Function

apoc.text

Qualified Name Type

apoc.text.doubleMetaphone(value) yield value - Compute the Double Metaphone phonetic encoding of all words of the text value which can be a single string or a list of strings

Procedure

apoc.text.phonetic(value) yield value - Compute the US_ENGLISH phonetic soundex encoding of all words of the text value which can be a single string or a list of strings

Procedure

apoc.text.phoneticDelta(text1, text2) yield phonetic1, phonetic2, delta - Compute the US_ENGLISH soundex character difference between two given strings

Procedure

apoc.text.base64Decode(text) YIELD value - Decode Base64 encoded string

Function

apoc.text.base64Encode(text) YIELD value - Encode a string with Base64

Function

apoc.text.base64UrlDecode(url) YIELD value - Decode Base64 encoded url

Function

apoc.text.base64UrlEncode(text) YIELD value - Encode a url with Base64

Function

apoc.text.byteCount(text,[charset]) - return size of text in bytes

Function

apoc.text.bytes(text,[charset]) - return bytes of the text

Function

apoc.text.camelCase(text) YIELD value - Convert a string to camelCase

Function

apoc.text.capitalize(text) YIELD value - capitalise the first letter of the word

Function

apoc.text.capitalizeAll(text) YIELD value - capitalise the first letter of every word in the text

Function

apoc.text.charAt(text, index) - the decimal value of the character at the given index

Function

apoc.text.clean(text) - strip the given string of everything except alpha numeric characters and convert it to lower case.

Function

apoc.text.code(codepoint) - Returns the unicode character of the given codepoint

Function

apoc.text.compareCleaned(text1, text2) - compare the given strings stripped of everything except alpha numeric characters converted to lower case.

Function

apoc.text.decapitalize(text) YIELD value - decapitalize the first letter of the word

Function

apoc.text.decapitalizeAll(text) YIELD value - decapitalize the first letter of all words

Function

apoc.text.distance(text1, text2) - compare the given strings with the Levenshtein distance algorithm.

Function

apoc.text.doubleMetaphone(value) yield value - Compute the Double Metaphone phonetic encoding of all words of the text value

Function

apoc.text.format(text,[params],language) - sprintf format the string with the params given

Function

apoc.text.fuzzyMatch(text1, text2) - check if 2 words can be matched in a fuzzy way. Depending on the length of the String it will allow more characters that needs to be edited to match the second String.

Function

apoc.text.hammingDistance(text1, text2) - compare the given strings with the Hamming distance algorithm.

Function

apoc.text.hexCharAt(text, index) - the hex value string of the character at the given index

Function

apoc.text.hexValue(value) - the hex value string of the given number

Function

apoc.text.indexOf(text, lookup, from=0, to=-1==len) - find the first occurence of the lookup string in the text, from inclusive, to exclusive, -1 if not found, null if text is null.

Function

apoc.text.indexesOf(text, lookup, from=0, to=-1==len) - finds all occurences of the lookup string in the text, return list, from inclusive, to exclusive, empty list if not found, null if text is null.

Function

apoc.text.jaroWinklerDistance(text1, text2) - compare the given strings with the Jaro-Winkler distance algorithm.

Function

apoc.text.join(['text1','text2',…​], delimiter) - join the given strings with the given delimiter.

Function

apoc.text.levenshteinDistance(text1, text2) - compare the given strings with the Levenshtein distance algorithm.

Function

apoc.text.levenshteinSimilarity(text1, text2) - calculate the similarity (a value within 0 and 1) between two texts.

Function

apoc.text.lpad(text,count,delim) YIELD value - left pad the string to the given width

Function

apoc.text.phonetic(text) yield value - Compute the US_ENGLISH phonetic soundex encoding of all words of the text

Function

apoc.text.random(length, valid) YIELD value - generate a random string

Function

apoc.text.regexGroups(text, regex) - return all matching groups of the regex on the given text.

Function

apoc.text.regreplace(text, regex, replacement) - replace each substring of the given string that matches the given regular expression with the given replacement.

Function

apoc.text.repeat(item, count) - string multiplication

Function

apoc.text.replace(text, regex, replacement) - replace each substring of the given string that matches the given regular expression with the given replacement.

Function

apoc.text.rpad(text,count,delim) YIELD value - right pad the string to the given width

Function

apoc.text.slug(text, delim) - slug the text with the given delimiter

Function

apoc.text.snakeCase(text) YIELD value - Convert a string to snake-case

Function

apoc.text.sorensenDiceSimilarityWithLanguage(text1, text2, languageTag) - compare the given strings with the Sørensen–Dice coefficient formula, with the provided IETF language tag

Function

apoc.text.split(text, regex, limit) - splits the given text around matches of the given regex.

Function

apoc.text.swapCase(text) YIELD value - Swap the case of a string

Function

apoc.text.toCypher(value, {skipKeys,keepKeys,skipValues,keepValues,skipNull,node,relationship,start,end}) | tries it’s best to convert the value to a cypher-property-string

Function

apoc.text.toUpperCase(text) YIELD value - Convert a string to UPPER_CASE

Function

apoc.text.upperCamelCase(text) YIELD value - Convert a string to camelCase

Function

apoc.text.urldecode(text) - return the urldecoded text

Function

apoc.text.urlencode(text) - return the urlencoded text

Function

apoc.trigger

Qualified Name Type

add a trigger kernelTransaction under a name, in the kernelTransaction you can use {createdNodes}, {deletedNodes} etc., the selector is {phase:'before/after/rollback'} returns previous and new trigger information. Takes in an optional configuration.

Procedure

list all installed triggers

Procedure

CALL apoc.trigger.pause(name) | it pauses the trigger

Procedure

remove previously added trigger, returns trigger information

Procedure

removes all previously added trigger, returns trigger information

Procedure

CALL apoc.trigger.resume(name) | it resumes the paused trigger

Procedure

function to filter labelEntries by label, to be used within a trigger kernelTransaction with {assignedLabels}, {removedLabels}, {assigned/removedNodeProperties}

Function

function to filter propertyEntries by property-key, to be used within a trigger kernelTransaction with {assignedNode/RelationshipProperties} and {removedNode/RelationshipProperties}. Returns [{old,new,key,node,relationship}]

Function

apoc.ttl

Qualified Name Type

CALL apoc.ttl.expireAtInstant(node,time,'time-unit') - expire node at specified time by setting :TTL label and ttl property

Procedure

CALL apoc.ttl.expireAfterTimeLength(node,timeDelta,'time-unit') - expire node after specified length of time time by setting :TTL label and ttl property

Procedure

apoc.util

Qualified Name Type

apoc.util.sleep(<duration>) | sleeps for <duration> millis, transaction termination is honored

Procedure

apoc.util.validate(predicate, message, params) | if the predicate yields to true raise an exception

Procedure

apoc.util.md5([values]) | computes the md5 of the concatenation of all string values of the list

Function

apoc.util.sha1([values]) | computes the sha1 of the concatenation of all string values of the list

Function

apoc.util.sha256([values]) | computes the sha256 of the concatenation of all string values of the list

Function

apoc.util.sha384([values]) | computes the sha384 of the concatenation of all string values of the list

Function

apoc.util.sha512([values]) | computes the sha512 of the concatenation of all string values of the list

Function

apoc.uuid

Qualified Name Type

CALL apoc.uuid.install(label, {addToExistingNodes: true/false, uuidProperty: 'uuid'}) yield label, installed, properties, batchComputationResult | it will add the uuid transaction handler for the provided label and uuidProperty, in case the UUID handler is already present it will be replaced by the new one

Procedure

CALL apoc.uuid.list() yield label, installed, properties | provides a list of all the uuid handlers installed with the related configuration

Procedure

CALL apoc.uuid.remove(label) yield label, installed, properties | remove previously added uuid handler and returns uuid information. All the existing uuid properties are left as-is

Procedure

CALL apoc.uuid.removeAll() yield label, installed, properties | it removes all previously added uuid handlers and returns uuids information. All the existing uuid properties are left as-is

Procedure

apoc.warmup

Qualified Name Type

apoc.warmup.run(loadProperties=false,loadDynamicProperties=false,loadIndexes=false) - quickly loads all nodes and rels into memory by skipping one page at a time

Procedure

apoc.xml

Qualified Name Type

Deprecated by apoc.import.xml

Procedure

RETURN apoc.xml.parse(<xml string>, <xPath string>, config, false) AS value

Function