contains() function
contains()
tests if an array contains a specified value and returns true
or false
.
Function type signature
(set: [A], value: A) => bool where A: Nullable
Parameters
value
(Required) Value to search for.
set
(Required) Array to search.
Examples
Filter on a set of specific fields
fields = ["f1", "f2"]
data
|> filter(fn: (r) => contains(value: r._field, set: fields))
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.