docs-v2/content/influxdb/cloud/reference/flux/stdlib/influxdb-schema/fieldkeys.md

1.7 KiB

title description menu weight influxdb/v2.0/tags aliases related introduced
schema.fieldKeys() function The `schema.fieldKeys()` function returns field keys in a bucket.
influxdb_cloud_ref
name parent
schema.fieldKeys InfluxDB schema
301
fields
/influxdb/cloud/reference/flux/functions/influxdb-v1/fieldkeys
/influxdb/cloud/query-data/flux/explore-schema/
/{{< latest "influxdb" "v1" >}}/query_language/explore-schema#show-field-keys, SHOW FIELD KEYS in InfluxQL
0.88.0

The schema.fieldKeys() function returns field keys in a bucket. The return value is always a single table with a single column, _value.

import "influxdata/influxdb/schema"

schema.fieldKeys(
  bucket: "example-bucket",
  predicate: (r) => true,
  start: -30d
)

Parameters

bucket

The bucket to list field keys from.

Data type: String

predicate

The predicate function that filters field keys. Defaults to (r) => true.

Data type: Function

start

The oldest time to include in results. Defaults to -30d.

Relative start times are defined using negative durations. Negative durations are relative to now. Absolute start times are defined using time values.

Data type: Duration

Examples

import "influxdata/influxdb/schema"

schema.fieldKeys(bucket: "my-bucket")

Function definition

package schema

fieldKeys = (bucket, predicate=(r) => true, start=-30d) =>
  tagValues(bucket: bucket, tag: "_field", predicate: predicate, start: start)

Used functions: schema.tagValues