Documentation

types.isType() function

types.isType() tests if a value is a specified Flux basic type or regular expression type.

import "types"

types.isType(v: 12, type: "int")

// Returns true

Parameters

v

(Required) Value to test.

type

(Required) Flux basic type.

Supported values:

  • string
  • bytes
  • int
  • uint
  • float
  • bool
  • time
  • duration
  • regexp

Examples

Filter fields by type

import "strings"

data
    |> filter(fn: (r) => types.isType(v: r._value, type: "string"))

View example input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.