# Add or update map > Supported in: Batch, Streaming Updates a value by key in a map or adds new key value pair. **Expression categories:** Map ## Declared arguments * **Expression:** Expression to set as value for the key.
*Expression\* * **Key:** Key to add or update.
*Expression\* * **Map:** Map expression.
*Expression\>* **Type variable bounds:** *K accepts AnyType\*\*V accepts AnyType* **Output type:** *Map\* ## Examples ### Example 1: Base case **Argument values:** * **Expression:** 4 * **Key:** k * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | {
 a -> 1,
 b -> 2,
} | {
 a -> 1,
 b -> 2,
 k -> 4,
} | *** ### Example 2: Base case **Argument values:** * **Expression:** 4 * **Key:** k * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | {
 a -> 1,
 b -> 2,
 k -> 2,
} | {
 a -> 1,
 b -> 2,
 k -> 4,
} | | {
 a -> 1,
 b -> 2,
} | {
 a -> 1,
 b -> 2,
 k -> 4,
} | *** ### Example 3: Base case **Argument values:** * **Expression:** 4 * **Key:** k * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | {
 a -> 1,
 b -> 2,
 k -> 2,
} | {
 a -> 1,
 b -> 2,
 k -> 4,
} | *** ### Example 4: Null case (ANSI mode off) **Argument values:** * **Expression:** 4 * **Key:** *null* * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | {
 a -> 1,
} | {
 a -> 1,
} | *** ### Example 5: Null case (ANSI mode on) **Argument values:** * **Expression:** 4 * **Key:** *null* * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | {
 a -> 1,
} | *null* | *** ### Example 6: Null case **Argument values:** * **Expression:** 4 * **Key:** k * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | *null* | *null* | *** ### Example 7: Null case **Argument values:** * **Expression:** *null* * **Key:** k * **Map:** `map_col` | map\_col | **Output** | | ----- | ----- | | {
 a -> 1,
} | {
 a -> 1,
 k -> *null*,
} | ***