github.com/eliastor/durgaform@v0.0.0-20220816172711-d0ab2d17673e/website/docs/language/functions/keys.mdx (about)

     1  ---
     2  page_title: keys - Functions - Configuration Language
     3  description: The keys function returns a list of the keys in a given map.
     4  ---
     5  
     6  # `keys` Function
     7  
     8  `keys` takes a map and returns a list containing the keys from that map.
     9  
    10  The keys are returned in lexicographical order, ensuring that the result will
    11  be identical as long as the keys in the map don't change.
    12  
    13  ## Examples
    14  
    15  ```
    16  > keys({a=1, c=2, d=3})
    17  [
    18    "a",
    19    "c",
    20    "d",
    21  ]
    22  ```
    23  
    24  ## Related Functions
    25  
    26  * [`values`](/language/functions/values) returns a list of the _values_ from a map.