apoc.convert.toBoolean

Function APOC Core

apoc.convert.toBoolean(value) | tries it’s best to convert the value to a boolean

Signature

apoc.convert.toBoolean(bool :: ANY?) :: (BOOLEAN?)

Input parameters

Name Type Default

bool

ANY?

null

Usage Examples

Convert number 1 to boolean
RETURN apoc.convert.toBoolean(1) AS output;
Table 1. Results
Output

true

Convert number 0 to boolean
RETURN apoc.convert.toBoolean(0) AS output;
Table 2. Results
Output

false