apoc.coll.fillObject

Function APOC Full

apoc.coll.fillObject(item, size) - returns a list of equals items with the given size

Signature

apoc.coll.fillObject(item = null :: ANY?, size = 0 :: LONG?) :: LIST OF ANY?

Input parameters

Name Type Default

item

ANY? OF DURATION?

null

Usage Examples

RETURN apoc.coll.fillObject() as value
Table 1. Results
value

[]

RETURN apoc.coll.fillObject('abc',2) as value
Table 2. Results
value

['abc', 'abc']

RETURN apoc.coll.fillObject(5,3) as value
Table 3. Results
value

[5, 5, 5]

WITH [1,2,3] AS item RETURN apoc.coll.fillObject(item, 3) as value
Table 4. Results
value

[[1,2,3], [1,2,3], [1,2,3]]

CREATE (node:Node {a: 1}) RETURN apoc.coll.fillObject(node, 2) as value
Table 5. Results
value

[(:Node {a: 1}), (:Node {a: 1})]