⌘+k ctrl+k
1.1.3 (stable)
Search Shortcut cmd + k | ctrl + k
Map Functions
Name Description
cardinality(map) Return the size of the map (or the number of entries in the map).
element_at(map, key) Return the value for a given key, or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys else an error is returned.
map_contains(map, key) Checks if a map contains a given key.
map_contains_entry(map, key, value) Check if a map contains a given key-value pair.
map_contains_value(map, value) Checks if a map contains a given value.
map_entries(map) Return a list of struct(k, v) for each key-value pair in the map.
map_extract(map, key) Return the value for a given key, or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys else an error is returned.
map_from_entries(STRUCT(k, v)[]) Returns a map created from the entries of the array.
map_keys(map) Return a list of all keys in the map.
map_values(map) Return a list of all values in the map.
map() Returns an empty map.
map[entry] Return the value for a given key, or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys else an error is returned.

cardinality(map)

Description Return the size of the map (or the number of entries in the map).
Example cardinality(map([4, 2], ['a', 'b']))
Result 2

element_at(map, key)

Description Return the value for a given key, or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys else an error is returned.
Example element_at(map([100, 5], [42, 43]), 100)
Result 42
Aliases map_extract(map, key), map[key]

map_contains(map, key)

Description Checks if a map contains a given key.
Example map_contains(MAP {'key1': 10, 'key2': 20, 'key3': 30}, 'key2')
Result true

map_contains_entry(map, key, value)

Description Check if a map contains a given key-value pair.
Example map_contains_entry(MAP {'key1': 10, 'key2': 20, 'key3': 30}, 'key2', 20)
Result true

map_contains_value(map, value)

Description Checks if a map contains a given value.
Example map_contains_value(MAP {'key1': 10, 'key2': 20, 'key3': 30}, 20)
Result true

map_entries(map)

Description Return a list of struct(k, v) for each key-value pair in the map.
Example map_entries(map([100, 5], [42, 43]))
Result [{'key': 100, 'value': 42}, {'key': 5, 'value': 43}]

map_extract(map, key)

Description Return the value for a given key, or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys else an error is returned.
Example map_extract(map([100, 5], [42, 43]), 100)
Result 42
Aliases element_at(map, key), map[key]

map_from_entries(STRUCT(k, v)[])

Description Returns a map created from the entries of the array.
Example map_from_entries([{k: 5, v: 'val1'}, {k: 3, v: 'val2'}])
Result {5=val1, 3=val2}

map_keys(map)

Description Return a list of all keys in the map.
Example map_keys(map([100, 5], [42,43]))
Result [100, 5]

map_values(map)

Description Return a list of all values in the map.
Example map_values(map([100, 5], [42, 43]))
Result [42, 43]

map()

Description Returns an empty map.
Example map()
Result {}

map[entry]

Description Return the value for a given key, or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys else an error is returned.
Example map([100, 5], ['a', 'b'])[100]
Result 'a'
Aliases element_at(map, key), map_extract(map, key)