Maps
The Maps registry offers tools for creating, manipulating, and interacting with map data structures, facilitating efficient data organization and retrieval.
dict
The function creates a dictionary (map) from a list of alternating keys and values, pairing each key with its corresponding value.
Signature
Must version
β
{{ dict "key1", "value1", "key2", "value2" }}
// Output: {"key1": "value1", "key2": "value2"}get
The function retrieves the value associated with a specified key from a dictionary (map). If the key is found, the corresponding value is returned.
Signature
Must version
β
{{ get {"key": "value"}, "key" }} // Output: "value"
{{ get {"key": "value"}, "invalid" }} // Output: ""set
The function adds a new key-value pair to a dictionary or updates the value associated with an existing key.
Signature
Must version
β
unset
Signature
Must version
β
keys
The function retrieves all keys from one or more dictionaries, returning them as a list.
Signature
Must version
β
values
The function retrieves all values from a dictionary, returning them as a list.
Signature
Must version
β
pluck
The function extracts values associated with a specified key from a list of dictionaries, returning a list of those values.
Signature
Must version
β
pick
The function creates a new dictionary that includes only the specified keys from the original dictionary, effectively filtering out all other keys and their associated values.
Signature
Must version
β
omit
The function creates a new dictionary by excluding the specified keys from the original dictionary, effectively removing those key-value pairs from the resulting dictionary.
Signature
Must version
β
dig
The function navigates through a nested dictionary structure using a sequence of keys and returns the value found at the specified path, allowing access to deeply nested data. The last argument must be the map.
Signature
Must version
β
hasKey
The function checks whether a specified key exists in the dictionary, returning true if the key is found and false otherwise.
Signature
Must version
β
merge / mustMerge
The function combines multiple source maps into a single destination map, adding new key-value pairs without overwriting any existing keys in the destination map.
Signature
Must version
β
mergeOverwrite / mustMergeOverwrite
The function combines multiple source maps into a destination map, overwriting existing keys with values from the source maps.
Signature
Must version
β
Last updated