apoc.coll.removeAll

Function

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

Signature

apoc.coll.removeAll(first :: LIST<ANY>, second :: LIST<ANY>) :: LIST<ANY>

Input parameters

Name Type Default

first

LIST<ANY>

null

second

LIST<ANY>

null

Usage examples

The following returns first list with all elements of second list removed:

RETURN apoc.coll.removeAll([1,2,3,4,5,6,6], [3,4,5]) AS output;
Table 1. Results
Output

[1, 2, 6, 6]