apoc.coll.removeAll

Function

apoc.coll.removeAll(list1 [Any], list2 [Any]) - returns the first list with all elements of the second list removed.

Signature

apoc.coll.removeAll(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

first

LIST? OF ANY?

null

second

LIST? OF 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]