Skip to main content

Map functions

map_access

Returns the value of the map for the given key. Returns null if the key is not found.

map_cat

Concatenates two maps. If the same key is present in both maps, the value from the second map is used.

map_contains

Returns true if the map contains the given key, false otherwise.

map_delete

Deletes a key-value pair from the map. No-op if the key is not found.

map_entries / map_keys / map_values

Returns an array of key-value pairs, keys, or values of the map.

map_filter

Added in v2.5.0. It is currently in technical preview stage.
Filters a map using a lambda function and returns key-value pairs that satisfy the condition.

map_from_entries

Constructs a map from an array of key-value pairs.

map_from_key_values

Constructs a map from an array of keys and an array of values.

map_length

Returns the number of key-value pairs in the map.

map_insert

Inserts a key-value pair into the map. If the key is already present, the value is updated.

Map operators

map [key] -> value

Alias of map_access.