Documentation

toUInt() function

The toUInt() function converts all values in the _value column to UIntegers.

Function type: Type conversion

toUInt()

Supported data types: Boolean | Duration | Float | Integer | Numeric String | Time

For duration and time values, toUint() returns the following:

Input typeReturned value
DurationThe number of nanoseconds in the specified duration
TimeA nanosecond epoch timestamp

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

Examples

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

Function definition

toUInt = (tables=<-) =>
  tables
    |> map(fn:(r) => ({ r with _value: uint(v:r._value) }))

Used functions: map(), uint()


New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: