Search Shortcut cmd + k | ctrl + k
Search cmd+k ctrl+k
Dark Mode
1.1 (stable)
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 a list containing the value for a given key or an empty list 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) Alias of element_at. Return a list containing the value for a given key or an empty list 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] Alias for element_at.

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 a list containing the value for a given key or an empty list 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]

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 Alias of element_at. Return a list containing the value for a given key or an empty list 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]

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 Alias for element_at.
Example map([100, 5], ['a', 'b'])[100]
Result [a]