apoc.coll.elements

Procedure APOC Core

apoc.coll.elements(list,limit,offset) yield _1,_2,..,_10,_1s,_2i,_3f,_4m,_5l,_6n,_7r,_8p - deconstruct subset of mixed list into identifiers of the correct type

Signature

apoc.coll.elements(values :: LIST? OF ANY?, limit = -1 :: INTEGER?, offset = 0 :: INTEGER?) :: (_1 :: ANY?, _2 :: ANY?, _3 :: ANY?, _4 :: ANY?, _5 :: ANY?, _6 :: ANY?, _7 :: ANY?, _8 :: ANY?, _9 :: ANY?, _10 :: ANY?, _1s :: STRING?, _2s :: STRING?, _3s :: STRING?, _4s :: STRING?, _5s :: STRING?, _6s :: STRING?, _7s :: STRING?, _8s :: STRING?, _9s :: STRING?, _10s :: STRING?, _1i :: INTEGER?, _2i :: INTEGER?, _3i :: INTEGER?, _4i :: INTEGER?, _5i :: INTEGER?, _6i :: INTEGER?, _7i :: INTEGER?, _8i :: INTEGER?, _9i :: INTEGER?, _10i :: INTEGER?, _1f :: FLOAT?, _2f :: FLOAT?, _3f :: FLOAT?, _4f :: FLOAT?, _5f :: FLOAT?, _6f :: FLOAT?, _7f :: FLOAT?, _8f :: FLOAT?, _9f :: FLOAT?, _10f :: FLOAT?, _1b :: BOOLEAN?, _2b :: BOOLEAN?, _3b :: BOOLEAN?, _4b :: BOOLEAN?, _5b :: BOOLEAN?, _6b :: BOOLEAN?, _7b :: BOOLEAN?, _8b :: BOOLEAN?, _9b :: BOOLEAN?, _10b :: BOOLEAN?, _1l :: LIST? OF ANY?, _2l :: LIST? OF ANY?, _3l :: LIST? OF ANY?, _4l :: LIST? OF ANY?, _5l :: LIST? OF ANY?, _6l :: LIST? OF ANY?, _7l :: LIST? OF ANY?, _8l :: LIST? OF ANY?, _9l :: LIST? OF ANY?, _10l :: LIST? OF ANY?, _1m :: MAP?, _2m :: MAP?, _3m :: MAP?, _4m :: MAP?, _5m :: MAP?, _6m :: MAP?, _7m :: MAP?, _8m :: MAP?, _9m :: MAP?, _10m :: MAP?, _1n :: NODE?, _2n :: NODE?, _3n :: NODE?, _4n :: NODE?, _5n :: NODE?, _6n :: NODE?, _7n :: NODE?, _8n :: NODE?, _9n :: NODE?, _10n :: NODE?, _1r :: RELATIONSHIP?, _2r :: RELATIONSHIP?, _3r :: RELATIONSHIP?, _4r :: RELATIONSHIP?, _5r :: RELATIONSHIP?, _6r :: RELATIONSHIP?, _7r :: RELATIONSHIP?, _8r :: RELATIONSHIP?, _9r :: RELATIONSHIP?, _10r :: RELATIONSHIP?, _1p :: PATH?, _2p :: PATH?, _3p :: PATH?, _4p :: PATH?, _5p :: PATH?, _6p :: PATH?, _7p :: PATH?, _8p :: PATH?, _9p :: PATH?, _10p :: PATH?, elements :: INTEGER?)

Input parameters

Name Type Default

values

LIST? OF ANY?

null

limit

INTEGER?

-1

offset

INTEGER?

0

Output parameters

Name Type

_1

ANY?

_2

ANY?

_3

ANY?

_4

ANY?

_5

ANY?

_6

ANY?

_7

ANY?

_8

ANY?

_9

ANY?

_10

ANY?

_1s

STRING?

_2s

STRING?

_3s

STRING?

_4s

STRING?

_5s

STRING?

_6s

STRING?

_7s

STRING?

_8s

STRING?

_9s

STRING?

_10s

STRING?

_1i

INTEGER?

_2i

INTEGER?

_3i

INTEGER?

_4i

INTEGER?

_5i

INTEGER?

_6i

INTEGER?

_7i

INTEGER?

_8i

INTEGER?

_9i

INTEGER?

_10i

INTEGER?

_1f

FLOAT?

_2f

FLOAT?

_3f

FLOAT?

_4f

FLOAT?

_5f

FLOAT?

_6f

FLOAT?

_7f

FLOAT?

_8f

FLOAT?

_9f

FLOAT?

_10f

FLOAT?

_1b

BOOLEAN?

_2b

BOOLEAN?

_3b

BOOLEAN?

_4b

BOOLEAN?

_5b

BOOLEAN?

_6b

BOOLEAN?

_7b

BOOLEAN?

_8b

BOOLEAN?

_9b

BOOLEAN?

_10b

BOOLEAN?

_1l

LIST? OF ANY?

_2l

LIST? OF ANY?

_3l

LIST? OF ANY?

_4l

LIST? OF ANY?

_5l

LIST? OF ANY?

_6l

LIST? OF ANY?

_7l

LIST? OF ANY?

_8l

LIST? OF ANY?

_9l

LIST? OF ANY?

_10l

LIST? OF ANY?

_1m

MAP?

_2m

MAP?

_3m

MAP?

_4m

MAP?

_5m

MAP?

_6m

MAP?

_7m

MAP?

_8m

MAP?

_9m

MAP?

_10m

MAP?

_1n

NODE?

_2n

NODE?

_3n

NODE?

_4n

NODE?

_5n

NODE?

_6n

NODE?

_7n

NODE?

_8n

NODE?

_9n

NODE?

_10n

NODE?

_1r

RELATIONSHIP?

_2r

RELATIONSHIP?

_3r

RELATIONSHIP?

_4r

RELATIONSHIP?

_5r

RELATIONSHIP?

_6r

RELATIONSHIP?

_7r

RELATIONSHIP?

_8r

RELATIONSHIP?

_9r

RELATIONSHIP?

_10r

RELATIONSHIP?

_1p

PATH?

_2p

PATH?

_3p

PATH?

_4p

PATH?

_5p

PATH?

_6p

PATH?

_7p

PATH?

_8p

PATH?

_9p

PATH?

_10p

PATH?

elements

INTEGER?

Usage Examples

The following deconstructs a list of 3 values into identifiers of the correct type:

CALL apoc.coll.elements([9, true, "Neo4j"])
YIELD _1, _1s, _1i, _1b, _1l, _1m, _1n, _1r, _1p,
      _2, _2s, _2i, _2b, _2l, _2m, _2n, _2r, _2p,
      _3, _3s, _3i, _3b, _3l, _3m, _3n, _3r, _3p
RETURN _1, _1s, _1i, _1b, _1l, _1m, _1n, _1r, _1p,
       _2, _2s, _2i, _2b, _2l, _2m, _2n, _2r, _2p,
       _3, _3s, _3i, _3b, _3l, _3m, _3n, _3r, _3p;

The output below would usually be in one table, but for readability we format it into multiple tables

Table 1. Results
_1 _1s _1i _1b _1l _1m _1n _1r _1p

9

NULL

9

NULL

NULL

NULL

NULL

NULL

NULL

Table 2. Results
_2 _2s _2i _2b _2l _2m _2n _2r _2p

TRUE

NULL

NULL

TRUE

NULL

NULL

NULL

NULL

NULL

Table 3. Results
_3 _3s _3i _3b _3l _3m _3n _3r _3p

"Neo4j"

"Neo4j"

NULL

NULL

NULL

NULL

NULL

NULL

NULL