apoc.coll.fill

Details

Syntax

apoc.coll.fill(item, count)

Description

Returns a LIST<ANY> with the given count of items.

Arguments

Name

Type

Description

item

STRING

The item to be present in the returned list.

count

INTEGER

The number of times the given item should appear in the returned list.

Returns

LIST<ANY>

Usage examples

The following examples return a list containing two 'abc' strings using both APOC and Cypher:

apoc.coll.fill
RETURN apoc.coll.fill('abc', 2) as output
Cypher’s list comprehension
RETURN [i IN range(1, 2) | 'abc'] as output
Results
Output

["abc", "abc"]