apoc.convert.toBooleanList

Function APOC Core Deprecated

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

Signature

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

Input parameters

Name Type Default

list

ANY?

null

Usage Examples

Convert list of values to list of booleans
return apoc.convert.toBooleanList(["true", 0, 1.1]) AS output;
Table 1. Results
Output

[TRUE, FALSE, TRUE]

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

Table 2. Migration Path to toBooelanList()
Input apoc.convert.toBooleanList() toBooleanList()

null

null

null

[true,false,true]

[true, false, true]

[true, false, true]

[0, 1, 2]

[false, true, true]

[false, true, true]

[0.1,1.1,2.1]

[false, true, true][1]

[null, null, null]

["true", "false", "true"]

[true, false, true]

[true, false, true]

[[true, false, true]]

[true]

[null]

"not-a-list"

[true]

Error

{a:"map"}

[true]

Error


1. Use toBooleanList(toIntegerList()) for this behavior in Neo4j