Collection Functions

APOC has a wide variety of Collection and List functions.

Qualified Name Type Release

apoc.coll.sum

Function

APOC Core

apoc.coll.avg

Function

APOC Core

apoc.coll.min

Function

APOC Core

apoc.coll.max

Function

APOC Core

apoc.coll.sumLongs

Function

APOC Core

apoc.coll.partition

Function

APOC Core

apoc.coll.zip

Function

APOC Core

apoc.coll.pairs

Function

APOC Core

apoc.coll.pairsMin

Function

APOC Core

apoc.coll.toSet

Function

APOC Core

apoc.coll.sort

Function

APOC Core

apoc.coll.sortNodes

Function

APOC Core

apoc.coll.sortMaps

- sort maps by property

Function

APOC Core

apoc.coll.reverse

- returns reversed list

Function

APOC Core

apoc.coll.contains

Function

APOC Core

apoc.coll.containsAll

Function

APOC Core

apoc.coll.containsSorted

Function

APOC Core

apoc.coll.containsAllSorted

Function

APOC Core

apoc.coll.isEqualCollection

Function

APOC Core

apoc.coll.union

- creates the distinct union of the 2 lists

Function

APOC Core

apoc.coll.unionAll

- creates the full union with duplicates of the two lists

Function

APOC Core

apoc.coll.subtract

- returns unique set of first list with all elements of second list removed

Function

APOC Core

apoc.coll.removeAll

- returns first list with all elements of second list removed

Function

APOC Core

apoc.coll.intersection

- returns the unique intersection of the two lists

Function

APOC Core

apoc.coll.disjunction

- returns the disjunct set of the two lists

Function

APOC Core

apoc.coll.split

Procedure

APOC Core

apoc.coll.indexOf

Function

APOC Core

apoc.coll.shuffle

- returns the shuffled list

Function

APOC Core

apoc.coll.randomItem

Function

APOC Core

apoc.coll.randomItems

- returns a list of itemCount random items from the original list, optionally allowing picked elements to be picked again

Function

APOC Core

apoc.coll.containsDuplicates

- returns true if a collection contains duplicate elements

Function

APOC Core

apoc.coll.duplicates

- returns a list of duplicate items in the collection

Function

APOC Core

apoc.coll.duplicatesWithCount

- 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 Core

apoc.coll.occurrences

- returns the count of the given item in the collection

Function

APOC Core

apoc.coll.frequencies

- 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 Core

apoc.coll.frequenciesAsMap

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

Function

APOC Core

apoc.coll.sortMulti

- sort list of maps by several sort fields (ascending with ^ prefix) and optionally applies limit and skip

Function

APOC Core

apoc.coll.flatten

- flattens list (nested if recursive is true)

Function

APOC Core

apoc.coll.combinations

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

Function

APOC Core

apoc.coll.elements

- deconstruct subset of mixed list into identifiers of the correct type

Procedure

APOC Core

apoc.coll.set

Function

APOC Core

apoc.coll.insert

Function

APOC Core

apoc.coll.insertAll

Function

APOC Core

apoc.coll.remove

Function

APOC Core

apoc.coll.different

- returns true if values are different

Function

APOC Core

apoc.coll.fill

- returns a list with the given count of items

Function

APOC Core

apoc.coll.sortText

Function

APOC Core

apoc.coll.pairWithOffset

- returns a list of pairs defined by the offset

Function

APOC Core