Docs

toBool() function

The toBool() function converts all values in the _value column to booleans.

Function type: Type conversion
Output data type: Boolean

toBool()

To convert values in a column other than _value, define a custom function patterned after the function definition, but replace the column in the bool() function with your desired column.

Examples

from(bucket: "telegraf")
  |> filter(fn:(r) =>
    r._measurement == "mem" and
    r._field == "used"
  )
  |> toBool()

Function definition

toBool = (tables=<-) =>
  tables
    |> map(fn:(r) => bool(v: r._value))

Used functions: map(), bool()