Documentation

toBool() function

toBool() converts all values in the _value column to boolean types.

Supported data types

  • string: true or false
  • int: 1 or 0
  • uint: 1 or 0
  • float: 1.0 or 0.0
Function type signature
(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B, _value: bool}]
For more information, see Function type signatures.

Parameters

tables

Input data. Default is piped-forward data (<-).

Examples

Convert an integer _value column to booleans

import "sampledata"

sampledata.numericBool()
    |> toBool()

View example input and ouput


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.