docs-v2/content/flux/v0.x/stdlib/universe/length.md

637 B

title description menu weight aliases related introduced
length() function The `length()` function returns the number of items in an array.
flux_0_x_ref
name parent
length universe
102
/influxdb/v2.0/reference/flux/stdlib/built-in/misc/length/
/influxdb/cloud/reference/flux/stdlib/built-in/misc/length/
/flux/v0.x/data-types/composite/array/
0.7.0

The length() function returns the number of items in an array.

length(arr: [])

Parameters

arr

Array to evaluate.

Examples

people = ["John", "Jane", "Abed"]

length(arr: people)

// Returns 3