Map Bin Operations
Map expressions use Collection Data Type (CDT) Map operations. These expressions return bins that can be used in other expressions that take a bin_expr
parameter.
Map Modify Operations
Map_modify expressions differ from CDT Map operations in that they return the modified bin instead of a specified return type (for remove_by ops) or predefined return type (The CDT operation put
returns an int for example).
map_clear
Introduced: 5.2.0.4
map_clear(context, bin)
Clear all elements in map bin.
- context (library_specific)
- bin (map_bin_expr)
Returns: (map_bin)
map_increment
Introduced: 5.2.0.4
map_increment(context, policy, key, delta, bin)
Increment element at key by delta.
- context (library_specific)
- policy (library_specific)
- key (expr)
- delta (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_put
Introduced: 5.2.0.4
map_put(context, policy, key, value, bin)
Add {key, value}
element to bin. map_put
does not create a new bin if the specified bin does not exist, unlike the put
CDT Map operation, which does create a new bin if the specified bin does not exist.
- context (library_specific)
- policy (library_specific)
- key (expr)
- value (expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_put_items
Introduced: 5.2.0.4
map_put_items(context, policy, items, bin)
Add elements in items
to bin. map_put_items
does not create a new bin if the specified bin does not exist, unlike the put_items
CDT Map operation, which does create a new bin if the specified bin does not exist.
- context (library_specific)
- policy (library_specific)
- items (map_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_index
Introduced: 5.2.0.4
map_remove_by_index(context, index, bin)
Remove element at index.
- context (library_specific)
- index (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_index_range
Introduced: 5.2.0.4
map_remove_by_index_range(context, index, count, bin)
Remove count element at index.
- context (library_specific)
- index (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_index_range_to_end
Introduced: 5.2.0.4
map_remove_by_index_range_to_end(context, index, bin)
Remove all element at and after index.
- context (library_specific)
- index (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_key
Introduced: 5.2.0.4
map_remove_by_key(context, key, bin)
Remove element with key key.
- context (library_specific)
- key (expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_key_list
Introduced: 5.2.0.4
map_remove_by_key_list(context, keys, bin)
Remove all elements where key โ keys.
- context (library_specific)
- keys (list_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_key_range
Introduced: 5.2.0.4
map_remove_by_key_range(context, start, end, bin)
Remove all elements with key k in interval start โค k < end.
- context (library_specific)
- start (expr)
- end (expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_rel_index_range
Introduced: 5.2.0.4
map_remove_by_rel_index_range(context, key, index, count, bin)
Remove count elements at index relative to key.
- context (library_specific)
- key (expr)
- index (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_rel_index_range_to_end
Introduced: 5.2.0.4
map_remove_by_rel_index_range_to_end(context, key, index, bin)
Remove all elements at and after index relative to key.
- context (library_specific)
- key (expr)
- index (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_rank
Introduced: 5.2.0.4
map_remove_by_rank(context, rank, bin)
Remove all element with rank rank.
- context (library_specific)
- rank (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_rank_range
Introduced: 5.2.0.4
map_remove_by_rank_range(context, rank, count, bin)
Remove count element at rank.
- context (library_specific)
- rank (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_rank_range_to_end
Introduced: 5.2.0.4
map_remove_by_rank_range_to_end(context, rank, bin)
Remove all elements at and after rank.
- context (library_specific)
- rank (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_value
Introduced: 5.2.0.4
map_remove_by_value(context, value, bin)
Remove all element with value value.
- context (library_specific)
- value (expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_value_list
Introduced: 5.2.0.4
map_remove_by_value_list(context, values, bin)
Remove all elements where value โ values.
- context (library_specific)
- values (list_expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_value_range
Introduced: 5.2.0.4
map_remove_by_value_range(context, start, end, bin)
Remove all elements with value v in interval start โค v < end.
- context (library_specific)
- start (expr)
- end (expr)
- bin (map_bin_expr)
Returns: (map_bin)
map_remove_by_rel_rank_range
Introduced: 5.2.0.4
map_remove_by_rel_rank_range(context, value, rank, count, bin)
Remove count elements at rank relative to value.
- context (library_specific)
- value (expr)
- rank (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
Returns: (map_bin)
Map Read Operations
Map_read expressions (other than MAP_SIZE) return a result based on their integer_value parameter. Calling single result CDT operations (e.g. MAP_GET_BY_INDEX) requires an integer_value when integer_value is MAP_RETURN_KEY or MAP_RETURN_VALUE as a map key or value can be any expression type.
map_get_by_index
Introduced: 5.2.0.4
map_get_by_index(type, context, result_type, index, bin)
Get element at index.
- type (integer_value)
- context (library_specific)
- result_type (integer_value)
- index (integer_expr)
- bin (map_bin_expr)
map_get_by_index_range
Introduced: 5.2.0.4
map_get_by_index_range(context, result_type, index, count, bin)
Get count elements at index.
- context (library_specific)
- result_type (integer_value)
- index (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
map_get_by_index_range_to_end
Introduced: 5.2.0.4
map_get_by_index_range_to_end(context, result_type, index, bin)
Get elements at and after index.
- context (library_specific)
- result_type (integer_value)
- index (integer_expr)
- bin (map_bin_expr)
map_get_by_key
Introduced: 5.2.0.4
map_get_by_key(type, context, result_type, key, bin)
Get element with key == key.
- type (integer_value)
- context (library_specific)
- result_type (integer_value)
- key (expr)
- bin (map_bin_expr)
map_get_by_key_list
Introduced: 5.2.0.4
map_get_by_key_list(context, result_type, keys, bin)
Get all elements where key โ keys.
- context (library_specific)
- result_type (integer_value)
- keys (list_expr)
- bin (map_bin_expr)
map_get_by_key_range
Introduced: 5.2.0.4
map_get_by_key_range(context, result_type, start, end, bin)
Get all elements with key k in interval start โค k < end.
- context (library_specific)
- result_type (integer_value)
- start (expr)
- end (expr)
- bin (map_bin_expr)
map_get_by_rank
Introduced: 5.2.0.4
map_get_by_rank(type, context, result_type, rank, bin)
Get element at rank.
- type (integer_value)
- context (library_specific)
- result_type (integer_value)
- rank (integer_expr)
- bin (map_bin_expr)
map_get_by_rank_range
Introduced: 5.2.0.4
map_get_by_rank_range(context, result_type, rank, count, bin)
Get count element at rank.
- context (library_specific)
- result_type (integer_value)
- rank (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
map_get_by_rank_range_to_end
Introduced: 5.2.0.4
map_get_by_rank_range_to_end(context, result_type, rank, bin)
Get all elements at and after rank.
- context (library_specific)
- result_type (integer_value)
- rank (integer_expr)
- bin (map_bin_expr)
map_get_by_rel_index_range
Introduced: 5.2.0.4
map_get_by_rel_index_range(context, result_type, key, index, count_expr, bin)
Get count elements at index relative to key.
- context (library_specific)
- result_type (integer_value)
- key (expr)
- index (integer_expr)
- count_expr (integer_expr)
- bin (map_bin_expr)
map_get_by_rel_index_range_to_end
Introduced: 5.2.0.4
map_get_by_rel_index_range_to_end(context, result_type, key, index_expr, bin)
Get all elements at and after index relative to key.
- context (library_specific)
- result_type (integer_value)
- key (expr)
- index_expr ()
- bin (map_bin_expr)
map_get_by_value
Introduced: 5.2.0.4
map_get_by_value(context, result_type, value, bin)
Get all elements where value == value.
- context (library_specific)
- result_type (integer_value)
- value (expr)
- bin (map_bin_expr)
map_get_by_value_list
Introduced: 5.2.0.4
map_get_by_value_list(context, result_type, values, bin)
Get all elements where value โ values.
- context (library_specific)
- result_type (integer_value)
- values (list_expr)
- bin (map_bin_expr)
map_get_by_value_range
Introduced: 5.2.0.4
map_get_by_value_range(context, result_type, start, end, bin)
Get all elements with value v in interval start โค v < end.
- context (library_specific)
- result_type (integer_value)
- start (integer_expr)
- end (integer_expr)
- bin (map_bin_expr)
map_get_by_rel_rank_range
Introduced: 5.2.0.4
map_get_by_rel_rank_range(context, result_type, value, rank, count, bin)
Remove count elements at rank relative to value.
- context (library_specific)
- result_type (integer_value)
- value (expr)
- rank (integer_expr)
- count (integer_expr)
- bin (map_bin_expr)
map_get_by_rel_rank_range_to_end
Introduced: 5.2.0.4
map_get_by_rel_rank_range_to_end(context, result_type, value, rank, bin)
Remove all elements at and after rank relative to value.
- context (library_specific)
- result_type (integer_value)
- value (expr)
- rank (integer_expr)
- bin (map_bin_expr)