apoc.coll.intersection

Function APOC Core

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

Signature

apoc.coll.intersection(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 the unique intersection of the two lists:

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

[3, 4, 5]