apoc.convert.toStringList

Function APOC Core Deprecated

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

Signature

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

Input parameters

Name Type Default

list

ANY?

null

Usage Examples

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

["1", "2", "3", "Four"]

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

Table 2. Migration Path to toStringList()
Input apoc.convert.toStringList() toStringList()

null

null

null

[true,false]

["true", "false"]

["true", "false"]

["a","b","c"]

["a","b","c"]

["a","b","c"]

[1,2.3,-4]

["1", "2.3", "-4"]

["1", "2.3", "-4"]

[["a","b","c"]]

[["a","b","c"]]

[null]

`"not-a-list"`[1]

["not-a-list"]

Error

{a:"map"} [1]

["{a=map}"]

Error

Node [1]

["Node[0]"]

Error

Relationship [1]

["(94)-[LEFT_BY,112]→(0)"]

Error

Path ()-[]-() [1]

["Node[0]", "(94)-[TYPE,112]→(0)", "Node[94]"]

Error


1. There is no Neo4j equivalent toStringList for these types