dict.fromList() function
dict.fromList()
creates a dictionary from a list of records with key
and value
properties.
Function type signature
(pairs: [{value: B, key: A}]) => [A:B] where A: Comparable
Parameters
pairs
(Required)
List of records with key
and value
properties.
Examples
Create a dictionary from a list of records
import "dict"
d =
dict.fromList(
pairs: [{key: 1, value: "foo"}, {key: 2, value: "bar"}],
)// Returns [1: "foo", 2: "bar"]
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.