fix: adjust examples to do what the headers suggest

pull/5629/head
B Tasker 2024-10-02 14:29:21 +01:00
parent 8948cd5486
commit 9549bacbb8
No known key found for this signature in database
GPG Key ID: F289CDD2317B182C
1 changed files with 4 additions and 3 deletions

View File

@ -139,9 +139,10 @@ Default is `(r) => true`.
```js ```js
import "influxdata/influxdb" import "influxdata/influxdb"
influxdb.cardinality(bucket: "example-bucket", start: -1y) influxdb.cardinality(bucket: "example-bucket", start: 1)
``` ```
Note: if points have been written into the future, you will need to add an appropriate `stop` date
### Query series cardinality in a measurement// ### Query series cardinality in a measurement//
@ -151,7 +152,7 @@ import "influxdata/influxdb"
influxdb.cardinality( influxdb.cardinality(
bucket: "example-bucket", bucket: "example-bucket",
start: -1y, start: 1,
predicate: (r) => r._measurement == "example-measurement", predicate: (r) => r._measurement == "example-measurement",
) )
@ -163,7 +164,7 @@ influxdb.cardinality(
```js ```js
import "influxdata/influxdb" import "influxdata/influxdb"
influxdb.cardinality(bucket: "example-bucket", start: -1y, predicate: (r) => r.exampleTag == "foo") influxdb.cardinality(bucket: "example-bucket", start: 1, predicate: (r) => r.exampleTag == "foo")
``` ```