github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/collection/merge.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: merge - Functions - Configuration Language
     4  sidebar_title: merge
     5  description: |-
     6    The merge function takes an arbitrary number of maps and returns a single
     7    map after merging the keys from each argument.
     8  ---
     9  
    10  # `merge` Function
    11  
    12  `merge` takes an arbitrary number of maps and returns a single map that
    13  contains a merged set of elements from all of the maps.
    14  
    15  If more than one given map defines the same key then the one that is later
    16  in the argument sequence takes precedence.
    17  
    18  ## Examples
    19  
    20  ```shell-session
    21  > merge({"a"="b", "c"="d"}, {"e"="f", "c"="z"})
    22  {
    23    "a" = "b"
    24    "c" = "z"
    25    "e" = "f"
    26  }
    27  ```