schema.fieldKeys() function

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

  1. import "influxdata/influxdb/schema"
  2. schema.fieldKeys(
  3. bucket: "example-bucket",
  4. predicate: (r) => true,
  5. start: -30d
  6. )

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

  1. import "influxdata/influxdb/schema"
  2. schema.fieldKeys(bucket: "my-bucket")

Function definition

  1. package schema
  2. fieldKeys = (bucket, predicate=(r) => true, start=-30d) =>
  3. tagValues(bucket: bucket, tag: "_field", predicate: predicate, start: start)

*Used functions: schema.tagValues*

Related articles

fields