apoc.convert.toIntList

Function APOC Core Deprecated

apoc.convert.toIntList(value) | tries it’s best to convert the value to a list of integers

Signature

apoc.convert.toIntList(list :: ANY?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

list

ANY?

null

Usage Examples

Convert list of strings to list of integers
return apoc.convert.toIntList(["1", "2", "3"]) AS output;
Table 1. Results
Output

[1, 2, 3]

This function has been deprecated and will be removed in version 5.0. This functionality is replaced by Neo4j’s toIntegerList() which has similar functionality. The following table is intended to assist migration by highlighting the differences:

Table 2. Migration Path to toIntegerList()
Input apoc.convert.toIntList() toIntegerList()

null

null

null

["1","2","c"]

[1, 2, NULL]

[1, 2, NULL]

null

null

null

[null]

[null]

[null]

[1.0, 1.4, 1.9]

[1, 1, 1]

[1, 1, 1]

[[1.0,1.4,1.9]]

[null]

[null]

[true,false,true]

[null, null, null]

[1, 0, 1]

"not-a-list"

[null]

Error

{a:"map"}

[null]

Error