Skip to main content
Loading

Map Bin Operations

Map expressions is a system for calling 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.

Arguments:
  • 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.

Arguments:
  • 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. Note that 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.

Arguments:
  • 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. Note that 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • context (library_specific)
  • value (expr)
  • rank (integer_expr)
  • count (integer_expr)
  • bin (map_bin_expr)

Returns: (map_bin)

map_remove_by_rel_rank_range_to_end

Introduced: 5.2.0.4

map_remove_by_rel_rank_range_to_end(context, value, rank, bin)

Remove all elements at and after rank relative to value.

Arguments:
  • context (library_specific)
  • value (expr)
  • rank (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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:
  • context (library_specific)
  • result_type (integer_value)
  • value (expr)
  • rank (integer_expr)
  • bin (map_bin_expr)

map_size

Introduced: 5.2.0.4

map_size(context, bin)

Get number of items in the map.

Arguments:
  • context (library_specific)
  • bin (map_bin_expr)

Returns: (integer_bin)