toBool() function

The toBool() function converts a value to a boolean.

Function type: Type conversion
Output data type: Boolean

toBool()

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))

This documentation is open source. See a typo? Please, open an issue.


Need help getting up and running? Get Support