I want to do cardinality calculations on every measurement in the system. I wanted to simply map over buckets and measurements but map does only support singular values. Is there any option to loop only but not map over collection ?
buckets()
|> map(fn: (r) => {
bucket = r.name
return schema.measurements(bucket: bucket)
|> map(fn: (r) => {
measurement = r._value
card = influxdb.cardinality(bucket: bucket, start: -1h, predicate: (r) => (r._measurement == measurement))
|> findRecord(idx: 0, fn: (key) =>
(true))
return { r with cardinality: card._value }
})
})
bucket map can only return single value and we have multiple measurements
Can it be done with Flux “v0.107.1-0.20210315004542-0546f24e73a0” ?