Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
Map Operations

Description

Unique key map bin operations. Create map operations used by the client operate command. The default unique key map is unordered. Valid map key types are:

The server will validate map key types in an upcoming release.

All maps maintain an index and a rank. The index is the item offset from the start of the map, for both unordered and ordered maps. The rank is the sorted index of the value component. Map supports negative indexing for index and rank.

Index examples:

Rank examples:

Code examples:

// bin = {key1=11, key2=22, key3=33}
// Set map value to 11 for map key "key2".
as_operations_inita(&ops, 1);
as_string_init(&key, "key2", false);
as_integer_init(&val, 11);
as_operations_map_put(&ops, "bin", NULL, NULL, (as_val*)&key, (as_val*)&val);
as_record* rec = NULL;
aerospike_key_operate(&as, &err, NULL, &key, &ops, &rec);
// bin result = {key1=11, key2=11, key3=33}
as_operations_destroy(&ops);
as_record_destroy(rec);
AS_EXTERN as_integer * as_integer_init(as_integer *integer, int64_t value)
AS_EXTERN as_string * as_string_init(as_string *string, char *value, bool free)
AS_EXTERN as_status aerospike_key_operate(aerospike *as, as_error *err, const as_policy_operate *policy, const as_key *key, const as_operations *ops, as_record **rec)
AS_EXTERN bool as_operations_map_put(as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)

Nested CDT operations are supported by optional context (as_cdt_ctx):

// bin = {key1={key11=9,key12=4}, key2={key21=3,key22=5}}
// Set map value to 11 for map key "key21" inside of map key "key2".
as_cdt_ctx_inita(&ctx, 1);
as_string_init(&str, "key2", false);
as_cdt_ctx_add_map_key(&ctx, (as_val*)&str);
as_operations_inita(&ops, 1);
as_string_init(&key, "key21", false);
as_integer_init(&val, 11);
as_operations_map_put(&ops, "bin", &ctx, NULL, (as_val*)&key, (as_val*)&val);
as_record* rec = NULL;
aerospike_key_operate(&as, &err, NULL, &key, &ops, &rec);
// bin result = {key1={key11=9,key12=4},key2={key21=11,key22=5}}
as_operations_destroy(&ops);
as_record_destroy(rec);
+ Collaboration diagram for Map Operations:

Data Structures

struct  as_map_policy
 

Enumerations

enum  as_map_order { AS_MAP_UNORDERED = 0 , AS_MAP_KEY_ORDERED = 1 , AS_MAP_KEY_VALUE_ORDERED = 3 }
 
enum  as_map_return_type {
  AS_MAP_RETURN_NONE = 0 , AS_MAP_RETURN_INDEX = 1 , AS_MAP_RETURN_REVERSE_INDEX = 2 , AS_MAP_RETURN_RANK = 3 ,
  AS_MAP_RETURN_REVERSE_RANK = 4 , AS_MAP_RETURN_COUNT = 5 , AS_MAP_RETURN_KEY = 6 , AS_MAP_RETURN_VALUE = 7 ,
  AS_MAP_RETURN_KEY_VALUE = 8 , AS_MAP_RETURN_EXISTS = 13 , AS_MAP_RETURN_UNORDERED_MAP = 16 , AS_MAP_RETURN_ORDERED_MAP = 17 ,
  AS_MAP_RETURN_INVERTED = 0x10000
}
 
enum  as_map_write_flags {
  AS_MAP_WRITE_DEFAULT = 0 , AS_MAP_WRITE_CREATE_ONLY = 1 , AS_MAP_WRITE_UPDATE_ONLY = 2 , AS_MAP_WRITE_NO_FAIL = 4 ,
  AS_MAP_WRITE_PARTIAL = 8
}
 
enum  as_map_write_mode { AS_MAP_UPDATE , AS_MAP_UPDATE_ONLY , AS_MAP_CREATE_ONLY }
 

Functions

AS_EXTERN void as_map_policy_init (as_map_policy *policy)
 
AS_EXTERN void as_map_policy_set (as_map_policy *policy, as_map_order order, as_map_write_mode mode)
 
AS_EXTERN void as_map_policy_set_all (as_map_policy *policy, as_map_order order, uint32_t flags, bool persist_index)
 
AS_EXTERN void as_map_policy_set_flags (as_map_policy *policy, as_map_order order, uint32_t flags)
 
static bool as_operations_add_map_clear (as_operations *ops, const char *name)
 
static bool as_operations_add_map_decrement (as_operations *ops, const char *name, as_map_policy *policy, as_val *key, as_val *value)
 
static bool as_operations_add_map_get_by_index (as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_index_range (as_operations *ops, const char *name, int64_t index, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_index_range_to_end (as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_key (as_operations *ops, const char *name, as_val *key, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_key_list (as_operations *ops, const char *name, as_list *keys, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_key_range (as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_key_rel_index_range (as_operations *ops, const char *name, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_key_rel_index_range_to_end (as_operations *ops, const char *name, as_val *key, int64_t index, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_rank (as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_rank_range (as_operations *ops, const char *name, int64_t rank, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_rank_range_to_end (as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_value (as_operations *ops, const char *name, as_val *value, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_value_list (as_operations *ops, const char *name, as_list *values, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_value_range (as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_value_rel_rank_range (as_operations *ops, const char *name, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_get_by_value_rel_rank_range_to_end (as_operations *ops, const char *name, as_val *value, int64_t rank, as_map_return_type return_type)
 
static bool as_operations_add_map_increment (as_operations *ops, const char *name, as_map_policy *policy, as_val *key, as_val *value)
 
static bool as_operations_add_map_put (as_operations *ops, const char *name, as_map_policy *policy, as_val *key, as_val *value)
 
static bool as_operations_add_map_put_items (as_operations *ops, const char *name, as_map_policy *policy, as_map *items)
 
static bool as_operations_add_map_remove_by_index (as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_index_range (as_operations *ops, const char *name, int64_t index, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_index_range_to_end (as_operations *ops, const char *name, int64_t index, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_key (as_operations *ops, const char *name, as_val *key, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_key_list (as_operations *ops, const char *name, as_list *keys, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_key_range (as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_key_rel_index_range (as_operations *ops, const char *name, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_key_rel_index_range_to_end (as_operations *ops, const char *name, as_val *key, int64_t index, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_rank (as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_rank_range (as_operations *ops, const char *name, int64_t rank, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_rank_range_to_end (as_operations *ops, const char *name, int64_t rank, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_value (as_operations *ops, const char *name, as_val *value, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_value_list (as_operations *ops, const char *name, as_list *values, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_value_range (as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_value_rel_rank_range (as_operations *ops, const char *name, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
 
static bool as_operations_add_map_remove_by_value_rel_rank_range_to_end (as_operations *ops, const char *name, as_val *value, int64_t rank, as_map_return_type return_type)
 
static bool as_operations_add_map_set_policy (as_operations *ops, const char *name, as_map_policy *policy)
 
static bool as_operations_add_map_size (as_operations *ops, const char *name)
 
AS_EXTERN bool as_operations_list_create_all (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list_order order, bool pad, bool persist_index)
 
AS_EXTERN bool as_operations_map_clear (as_operations *ops, const char *name, as_cdt_ctx *ctx)
 
AS_EXTERN bool as_operations_map_create (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_order order)
 
AS_EXTERN bool as_operations_map_create_all (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_order order, bool persist_index)
 
AS_EXTERN bool as_operations_map_decrement (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)
 
AS_EXTERN bool as_operations_map_get_by_index (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_index_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_index_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_key (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_key_list (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *keys, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_key_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_key_rel_index_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_key_rel_index_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_rank (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_rank_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_rank_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_value (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_value_list (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *values, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_value_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_value_rel_rank_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_get_by_value_rel_rank_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_increment (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)
 
AS_EXTERN bool as_operations_map_put (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_val *key, as_val *value)
 
AS_EXTERN bool as_operations_map_put_items (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy, as_map *items)
 
AS_EXTERN bool as_operations_map_remove_by_index (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_index_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_index_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t index, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_key (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_key_list (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *keys, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_key_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_key_rel_index_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_key_rel_index_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *key, int64_t index, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_rank (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_rank_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_rank_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, int64_t rank, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_value (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_value_list (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_list *values, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_value_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *begin, as_val *end, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_value_rel_rank_range (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, uint64_t count, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_remove_by_value_rel_rank_range_to_end (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_val *value, int64_t rank, as_map_return_type return_type)
 
AS_EXTERN bool as_operations_map_set_policy (as_operations *ops, const char *name, as_cdt_ctx *ctx, as_map_policy *policy)
 
AS_EXTERN bool as_operations_map_size (as_operations *ops, const char *name, as_cdt_ctx *ctx)
 

Enumeration Type Documentation

◆ as_map_order

Map storage order.

Enumerator
AS_MAP_UNORDERED 

Map is not ordered. This is the default.

AS_MAP_KEY_ORDERED 

Order map by key.

AS_MAP_KEY_VALUE_ORDERED 

Order map by key, then value.

Definition at line 51 of file as_cdt_order.h.

◆ as_map_return_type

Map return type. Type of data to return when selecting or removing items from the map.

Enumerator
AS_MAP_RETURN_NONE 

Do not return a result.

AS_MAP_RETURN_INDEX 

Return key index order.

AS_MAP_RETURN_REVERSE_INDEX 

Return reverse key order.

AS_MAP_RETURN_RANK 

Return value order.

AS_MAP_RETURN_REVERSE_RANK 

Return reverse value order.

AS_MAP_RETURN_COUNT 

Return count of items selected.

AS_MAP_RETURN_KEY 

Return key for single key read and key list for range read.

AS_MAP_RETURN_VALUE 

Return value for single key read and value list for range read.

AS_MAP_RETURN_KEY_VALUE 

Return key/value items.

AS_MAP_RETURN_EXISTS 

Return true if count > 0.

AS_MAP_RETURN_UNORDERED_MAP 

Return an unordered map.

AS_MAP_RETURN_ORDERED_MAP 

Return an ordered map.

AS_MAP_RETURN_INVERTED 

Invert meaning of map command and return values. For example:

as_operations_inita(&ops, 1);
as_operations_add_map_remove_by_key_range(&ops, BIN_NAME, (as_val*)&mkey1, (as_val*)&mkey2,
as_record* rec = NULL;
as_status status = aerospike_key_operate(as, &err, NULL, &key, &ops, &rec);
as_operations_destroy(&ops);
as_status
Definition as_status.h:30
static bool as_operations_add_map_remove_by_key_range(as_operations *ops, const char *name, as_val *begin, as_val *end, as_map_return_type return_type)
@ AS_MAP_RETURN_KEY
@ AS_MAP_RETURN_INVERTED

With AS_MAP_RETURN_INVERTED enabled, the keys outside of the specified key range will be removed and returned.

Definition at line 200 of file as_map_operations.h.

◆ as_map_write_flags

Map write bit flags. Requires server versions >= 4.3.

Enumerator
AS_MAP_WRITE_DEFAULT 

Default. Allow create or update.

AS_MAP_WRITE_CREATE_ONLY 

If the key already exists, the item will be denied. If the key does not exist, a new item will be created.

AS_MAP_WRITE_UPDATE_ONLY 

If the key already exists, the item will be overwritten. If the key does not exist, the item will be denied.

AS_MAP_WRITE_NO_FAIL 

Do not raise error if a map item is denied due to write flag constraints.

AS_MAP_WRITE_PARTIAL 

Allow other valid map items to be committed if a map item is denied due to write flag constraints.

Definition at line 153 of file as_map_operations.h.

◆ as_map_write_mode

Map write mode. This enum should only be used for server versions < 4.3. as_map_write_flags is recommended for server versions >= 4.3.

Enumerator
AS_MAP_UPDATE 

If the key already exists, the item will be overwritten. If the key does not exist, a new item will be created.

AS_MAP_UPDATE_ONLY 

If the key already exists, the item will be overwritten. If the key does not exist, the write will fail.

AS_MAP_CREATE_ONLY 

If the key already exists, the write will fail. If the key does not exist, a new item will be created.

Definition at line 127 of file as_map_operations.h.

Function Documentation

◆ as_map_policy_init()

AS_EXTERN void as_map_policy_init ( as_map_policy * policy)

Initialize map attributes to default unordered map with standard overwrite semantics.

◆ as_map_policy_set()

AS_EXTERN void as_map_policy_set ( as_map_policy * policy,
as_map_order order,
as_map_write_mode mode )

Set map attributes to specified map order and write mode semantics.

This function should only be used for server versions < 4.3. as_map_policy_set_flags is recommended for server versions >= 4.3.

◆ as_map_policy_set_all()

AS_EXTERN void as_map_policy_set_all ( as_map_policy * policy,
as_map_order order,
uint32_t flags,
bool persist_index )

Set map attributes to specified map order, write flags and whether to persist the map index.

Parameters
policyTarget map policy.
orderMap order.
flagsMap write flags. See as_map_write_flags.
persist_indexIf true, persist map index. A map index improves lookup performance, but requires more storage. A map index can be created for a top-level ordered map only. Nested and unordered map indexes are not supported.

◆ as_map_policy_set_flags()

AS_EXTERN void as_map_policy_set_flags ( as_map_policy * policy,
as_map_order order,
uint32_t flags )

Set map attributes to specified map order and write flags (See as_map_write_flags).

◆ as_operations_add_map_clear()

static bool as_operations_add_map_clear ( as_operations * ops,
const char * name )
inlinestatic

Create map clear operation. Server removes all items in map. Server returns null.

Definition at line 1102 of file as_map_operations.h.

References as_operations_map_clear().

◆ as_operations_add_map_decrement()

static bool as_operations_add_map_decrement ( as_operations * ops,
const char * name,
as_map_policy * policy,
as_val * key,
as_val * value )
inlinestatic

Create map decrement operation. Server decrement values by decr for all items identified by key and returns final result. Valid only for numbers.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

Definition at line 1088 of file as_map_operations.h.

References as_operations_map_decrement().

◆ as_operations_add_map_get_by_index()

static bool as_operations_add_map_get_by_index ( as_operations * ops,
const char * name,
int64_t index,
as_map_return_type return_type )
inlinestatic

Create map get by index operation. Server selects map item identified by index and returns selected data specified by return_type.

Definition at line 1607 of file as_map_operations.h.

References as_operations_map_get_by_index().

◆ as_operations_add_map_get_by_index_range()

static bool as_operations_add_map_get_by_index_range ( as_operations * ops,
const char * name,
int64_t index,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map get by index range operation. Server selects count map items starting at specified index and returns selected data specified by return_type.

Definition at line 1637 of file as_map_operations.h.

References as_operations_map_get_by_index_range().

◆ as_operations_add_map_get_by_index_range_to_end()

static bool as_operations_add_map_get_by_index_range_to_end ( as_operations * ops,
const char * name,
int64_t index,
as_map_return_type return_type )
inlinestatic

Create map get by index range operation. Server selects map items starting at specified index to the end of map and returns selected data specified by return_type.

Definition at line 1622 of file as_map_operations.h.

References as_operations_map_get_by_index_range_to_end().

◆ as_operations_add_map_get_by_key()

static bool as_operations_add_map_get_by_key ( as_operations * ops,
const char * name,
as_val * key,
as_map_return_type return_type )
inlinestatic

Create map get by key operation. Server selects map item identified by key and returns selected data specified by return_type.

Definition at line 1411 of file as_map_operations.h.

References as_operations_map_get_by_key().

◆ as_operations_add_map_get_by_key_list()

static bool as_operations_add_map_get_by_key_list ( as_operations * ops,
const char * name,
as_list * keys,
as_map_return_type return_type )
inlinestatic

Create map get by key list operation. Server selects map items identified by keys and returns selected data specified by return_type.

Definition at line 1444 of file as_map_operations.h.

References as_operations_map_get_by_key_list().

◆ as_operations_add_map_get_by_key_range()

static bool as_operations_add_map_get_by_key_range ( as_operations * ops,
const char * name,
as_val * begin,
as_val * end,
as_map_return_type return_type )
inlinestatic

Create map get by key range operation. Server selects map items identified by key range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns selected data specified by return_type.

Definition at line 1429 of file as_map_operations.h.

References as_operations_map_get_by_key_range().

◆ as_operations_add_map_get_by_key_rel_index_range()

static bool as_operations_add_map_get_by_key_rel_index_range ( as_operations * ops,
const char * name,
as_val * key,
int64_t index,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map get by key relative to index range operation. Server selects map items nearest to key and greater by index with a count limit. Server returns selected data specified by return_type.

Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index,count) = [selected items]
  • (5,0,1) = [{5=15}]
  • (5,1,2) = [{9=10}]
  • (5,-1,1) = [{4=2}]
  • (3,2,1) = [{9=10}]
  • (3,-2,2) = [{0=17}]

Definition at line 1496 of file as_map_operations.h.

References as_operations_map_get_by_key_rel_index_range().

◆ as_operations_add_map_get_by_key_rel_index_range_to_end()

static bool as_operations_add_map_get_by_key_rel_index_range_to_end ( as_operations * ops,
const char * name,
as_val * key,
int64_t index,
as_map_return_type return_type )
inlinestatic

Create map get by key relative to index range operation. Server selects map items nearest to key and greater by index. Server returns selected data specified by return_type.

Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index) = [selected items]
  • (5,0) = [{5=15},{9=10}]
  • (5,1) = [{9=10}]
  • (5,-1) = [{4=2},{5=15},{9=10}]
  • (3,2) = [{9=10}]
  • (3,-2) = [{0=17},{4=2},{5=15},{9=10}]

Definition at line 1469 of file as_map_operations.h.

References as_operations_map_get_by_key_rel_index_range_to_end().

◆ as_operations_add_map_get_by_rank()

static bool as_operations_add_map_get_by_rank ( as_operations * ops,
const char * name,
int64_t rank,
as_map_return_type return_type )
inlinestatic

Create map get by rank operation. Server selects map item identified by rank and returns selected data specified by return_type.

Definition at line 1652 of file as_map_operations.h.

References as_operations_map_get_by_rank().

◆ as_operations_add_map_get_by_rank_range()

static bool as_operations_add_map_get_by_rank_range ( as_operations * ops,
const char * name,
int64_t rank,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map get by rank range operation. Server selects count map items starting at specified rank and returns selected data specified by return_type.

Definition at line 1682 of file as_map_operations.h.

References as_operations_map_get_by_rank_range().

◆ as_operations_add_map_get_by_rank_range_to_end()

static bool as_operations_add_map_get_by_rank_range_to_end ( as_operations * ops,
const char * name,
int64_t rank,
as_map_return_type return_type )
inlinestatic

Create map get by rank range operation. Server selects map items starting at specified rank to the last ranked item and returns selected data specified by return_type.

Definition at line 1667 of file as_map_operations.h.

References as_operations_map_get_by_rank_range_to_end().

◆ as_operations_add_map_get_by_value()

static bool as_operations_add_map_get_by_value ( as_operations * ops,
const char * name,
as_val * value,
as_map_return_type return_type )
inlinestatic

Create map get by value operation. Server selects map items identified by value and returns selected data specified by return_type.

Definition at line 1512 of file as_map_operations.h.

References as_operations_map_get_by_value().

◆ as_operations_add_map_get_by_value_list()

static bool as_operations_add_map_get_by_value_list ( as_operations * ops,
const char * name,
as_list * values,
as_map_return_type return_type )
inlinestatic

Create map get by value list operation. Server selects map items identified by values and returns selected data specified by return_type.

Definition at line 1545 of file as_map_operations.h.

References as_operations_map_get_by_value_list().

◆ as_operations_add_map_get_by_value_range()

static bool as_operations_add_map_get_by_value_range ( as_operations * ops,
const char * name,
as_val * begin,
as_val * end,
as_map_return_type return_type )
inlinestatic

Create map get by value range operation. Server selects map items identified by value range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns selected data specified by return_type.

Definition at line 1530 of file as_map_operations.h.

References as_operations_map_get_by_value_range().

◆ as_operations_add_map_get_by_value_rel_rank_range()

static bool as_operations_add_map_get_by_value_rel_rank_range ( as_operations * ops,
const char * name,
as_val * value,
int64_t rank,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map get by value relative to rank range operation. Server selects map items nearest to value and greater by relative rank with a count limit. Server returns selected data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank,count) = [selected items]
  • (11,1,1) = [{0=17}]
  • (11,-1,1) = [{9=10}]

Definition at line 1591 of file as_map_operations.h.

References as_operations_map_get_by_value_rel_rank_range().

◆ as_operations_add_map_get_by_value_rel_rank_range_to_end()

static bool as_operations_add_map_get_by_value_rel_rank_range_to_end ( as_operations * ops,
const char * name,
as_val * value,
int64_t rank,
as_map_return_type return_type )
inlinestatic

Create map get by value relative to rank range operation. Server selects map items nearest to value and greater by relative rank. Server returns selected data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank) = [selected items]
  • (11,1) = [{0=17}]
  • (11,-1) = [{9=10},{5=15},{0=17}]

Definition at line 1567 of file as_map_operations.h.

References as_operations_map_get_by_value_rel_rank_range_to_end().

◆ as_operations_add_map_increment()

static bool as_operations_add_map_increment ( as_operations * ops,
const char * name,
as_map_policy * policy,
as_val * key,
as_val * value )
inlinestatic

Create map increment operation. Server increments values by incr for all items identified by key and returns final result. Valid only for numbers.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

Definition at line 1069 of file as_map_operations.h.

References as_operations_map_increment().

◆ as_operations_add_map_put()

static bool as_operations_add_map_put ( as_operations * ops,
const char * name,
as_map_policy * policy,
as_val * key,
as_val * value )
inlinestatic

Create map put operation. Server writes key/value item to map bin and returns map size.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

Definition at line 1032 of file as_map_operations.h.

References as_operations_map_put().

◆ as_operations_add_map_put_items()

static bool as_operations_add_map_put_items ( as_operations * ops,
const char * name,
as_map_policy * policy,
as_map * items )
inlinestatic

Create map put items operation. Server writes each map item to map bin and returns map size.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

Definition at line 1050 of file as_map_operations.h.

References as_operations_map_put_items().

◆ as_operations_add_map_remove_by_index()

static bool as_operations_add_map_remove_by_index ( as_operations * ops,
const char * name,
int64_t index,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map item identified by index and returns removed data specified by return_type.

Definition at line 1309 of file as_map_operations.h.

References as_operations_map_remove_by_index().

◆ as_operations_add_map_remove_by_index_range()

static bool as_operations_add_map_remove_by_index_range ( as_operations * ops,
const char * name,
int64_t index,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes count map items starting at specified index and returns removed data specified by return_type.

Definition at line 1339 of file as_map_operations.h.

References as_operations_map_remove_by_index_range().

◆ as_operations_add_map_remove_by_index_range_to_end()

static bool as_operations_add_map_remove_by_index_range_to_end ( as_operations * ops,
const char * name,
int64_t index,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items starting at specified index to the end of map and returns removed data specified by return_type.

Definition at line 1324 of file as_map_operations.h.

References as_operations_map_remove_by_index_range_to_end().

◆ as_operations_add_map_remove_by_key()

static bool as_operations_add_map_remove_by_key ( as_operations * ops,
const char * name,
as_val * key,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map item identified by key and returns removed data specified by return_type.

Definition at line 1114 of file as_map_operations.h.

References as_operations_map_remove_by_key().

◆ as_operations_add_map_remove_by_key_list()

static bool as_operations_add_map_remove_by_key_list ( as_operations * ops,
const char * name,
as_list * keys,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items identified by keys and returns removed data specified by return_type.

Definition at line 1128 of file as_map_operations.h.

References as_operations_map_remove_by_key_list().

◆ as_operations_add_map_remove_by_key_range()

static bool as_operations_add_map_remove_by_key_range ( as_operations * ops,
const char * name,
as_val * begin,
as_val * end,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items identified by key range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns removed data specified by return_type.

Definition at line 1146 of file as_map_operations.h.

References as_operations_map_remove_by_key_range().

◆ as_operations_add_map_remove_by_key_rel_index_range()

static bool as_operations_add_map_remove_by_key_rel_index_range ( as_operations * ops,
const char * name,
as_val * key,
int64_t index,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map remove by key relative to index range operation. Server removes map items nearest to key and greater by index with a count limit. Server returns removed data specified by return_type.

Examples for map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index,count) = [removed items]
  • (5,0,1) = [{5=15}]
  • (5,1,2) = [{9=10}]
  • (5,-1,1) = [{4=2}]
  • (3,2,1) = [{9=10}]
  • (3,-2,2) = [{0=17}]

Definition at line 1198 of file as_map_operations.h.

References as_operations_map_remove_by_key_rel_index_range().

◆ as_operations_add_map_remove_by_key_rel_index_range_to_end()

static bool as_operations_add_map_remove_by_key_rel_index_range_to_end ( as_operations * ops,
const char * name,
as_val * key,
int64_t index,
as_map_return_type return_type )
inlinestatic

Create map remove by key relative to index range operation. Server removes map items nearest to key and greater by index. Server returns removed data specified by return_type.

Examples for map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index) = [removed items]
  • (5,0) = [{5=15},{9=10}]
  • (5,1) = [{9=10}]
  • (5,-1) = [{4=2},{5=15},{9=10}]
  • (3,2) = [{9=10}]
  • (3,-2) = [{0=17},{4=2},{5=15},{9=10}]

Definition at line 1172 of file as_map_operations.h.

References as_operations_map_remove_by_key_rel_index_range_to_end().

◆ as_operations_add_map_remove_by_rank()

static bool as_operations_add_map_remove_by_rank ( as_operations * ops,
const char * name,
int64_t rank,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map item identified by rank and returns removed data specified by return_type.

Definition at line 1354 of file as_map_operations.h.

References as_operations_map_remove_by_rank().

◆ as_operations_add_map_remove_by_rank_range()

static bool as_operations_add_map_remove_by_rank_range ( as_operations * ops,
const char * name,
int64_t rank,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes count map items starting at specified rank and returns removed data specified by return_type.

Definition at line 1384 of file as_map_operations.h.

References as_operations_map_remove_by_rank_range().

◆ as_operations_add_map_remove_by_rank_range_to_end()

static bool as_operations_add_map_remove_by_rank_range_to_end ( as_operations * ops,
const char * name,
int64_t rank,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items starting at specified rank to the last ranked item and returns removed data specified by return_type.

Definition at line 1369 of file as_map_operations.h.

References as_operations_map_remove_by_rank_range_to_end().

◆ as_operations_add_map_remove_by_value()

static bool as_operations_add_map_remove_by_value ( as_operations * ops,
const char * name,
as_val * value,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items identified by value and returns removed data specified by return_type.

Definition at line 1214 of file as_map_operations.h.

References as_operations_map_remove_by_value().

◆ as_operations_add_map_remove_by_value_list()

static bool as_operations_add_map_remove_by_value_list ( as_operations * ops,
const char * name,
as_list * values,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items identified by values and returns removed data specified by return_type.

Definition at line 1228 of file as_map_operations.h.

References as_operations_map_remove_by_value_list().

◆ as_operations_add_map_remove_by_value_range()

static bool as_operations_add_map_remove_by_value_range ( as_operations * ops,
const char * name,
as_val * begin,
as_val * end,
as_map_return_type return_type )
inlinestatic

Create map remove operation. Server removes map items identified by value range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns removed data specified by return_type.

Definition at line 1246 of file as_map_operations.h.

References as_operations_map_remove_by_value_range().

◆ as_operations_add_map_remove_by_value_rel_rank_range()

static bool as_operations_add_map_remove_by_value_rel_rank_range ( as_operations * ops,
const char * name,
as_val * value,
int64_t rank,
uint64_t count,
as_map_return_type return_type )
inlinestatic

Create map remove by value relative to rank range operation. Server removes map items nearest to value and greater by relative rank with a count limit. Server returns removed data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank,count) = [removed items]
  • (11,1,1) = [{0=17}]
  • (11,-1,1) = [{9=10}]

Definition at line 1293 of file as_map_operations.h.

References as_operations_map_remove_by_value_rel_rank_range().

◆ as_operations_add_map_remove_by_value_rel_rank_range_to_end()

static bool as_operations_add_map_remove_by_value_rel_rank_range_to_end ( as_operations * ops,
const char * name,
as_val * value,
int64_t rank,
as_map_return_type return_type )
inlinestatic

Create map remove by value relative to rank range operation. Server removes map items nearest to value and greater by relative rank. Server returns removed data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank) = [removed items]
  • (11,1) = [{0=17}]
  • (11,-1) = [{9=10},{5=15},{0=17}]

Definition at line 1269 of file as_map_operations.h.

References as_operations_map_remove_by_value_rel_rank_range_to_end().

◆ as_operations_add_map_set_policy()

static bool as_operations_add_map_set_policy ( as_operations * ops,
const char * name,
as_map_policy * policy )
inlinestatic

Create set map policy operation. Server sets map policy attributes. Server does not return a value.

Definition at line 1016 of file as_map_operations.h.

References as_operations_map_set_policy().

◆ as_operations_add_map_size()

static bool as_operations_add_map_size ( as_operations * ops,
const char * name )
inlinestatic

Create map size operation. Server returns size of map.

Definition at line 1399 of file as_map_operations.h.

References as_operations_map_size().

◆ as_operations_list_create_all()

AS_EXTERN bool as_operations_list_create_all ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_list_order order,
bool pad,
bool persist_index )

Create list create operation. Server creates list at given context level.

Parameters
opsTarget operations list.
nameBin name.
ctxOptional path to nested list. If not defined, the top-level list is used.
orderList order.
padIf true, the context is allowed to be beyond list boundaries. In that case, nil list entries will be inserted to satisfy the context position.
persist_indexIf true, persist list index. A list index improves lookup performance, but requires more storage. A list index can be created for a top-level ordered list only. Nested and unordered list indexes are not supported.

◆ as_operations_map_clear()

AS_EXTERN bool as_operations_map_clear ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx )

Create map clear operation. Server removes all items in map. Server returns null.

◆ as_operations_map_create()

AS_EXTERN bool as_operations_map_create ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_order order )

Create map create operation. Server creates map at given context level.

◆ as_operations_map_create_all()

AS_EXTERN bool as_operations_map_create_all ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_order order,
bool persist_index )

Create map create operation. Server creates map at given context level.

Parameters
opsTarget operations list.
nameBin name.
ctxOptional path to nested map. If not defined, the top-level map is used.
orderMap order.
persist_indexIf true, persist map index. A map index improves lookup performance, but requires more storage. A map index can be created for a top-level ordered map only. Nested and unordered map indexes are not supported.

◆ as_operations_map_decrement()

AS_EXTERN bool as_operations_map_decrement ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_policy * policy,
as_val * key,
as_val * value )

Create map decrement operation. Server decrement values by decr for all items identified by key and returns final result. Valid only for numbers.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

This function takes ownership and frees heap memory associated with key/value parameters.

Deprecated
Use as_operations_map_increment() with negative value instead.

◆ as_operations_map_get_by_index()

AS_EXTERN bool as_operations_map_get_by_index ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t index,
as_map_return_type return_type )

Create map get by index operation. Server selects map item identified by index and returns selected data specified by return_type.

◆ as_operations_map_get_by_index_range()

AS_EXTERN bool as_operations_map_get_by_index_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t index,
uint64_t count,
as_map_return_type return_type )

Create map get by index range operation. Server selects count map items starting at specified index and returns selected data specified by return_type.

◆ as_operations_map_get_by_index_range_to_end()

AS_EXTERN bool as_operations_map_get_by_index_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t index,
as_map_return_type return_type )

Create map get by index range operation. Server selects map items starting at specified index to the end of map and returns selected data specified by return_type.

◆ as_operations_map_get_by_key()

AS_EXTERN bool as_operations_map_get_by_key ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * key,
as_map_return_type return_type )

Create map get by key operation. Server selects map item identified by key and returns selected data specified by return_type.

This function takes ownership and frees heap memory associated with key parameter.

◆ as_operations_map_get_by_key_list()

AS_EXTERN bool as_operations_map_get_by_key_list ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_list * keys,
as_map_return_type return_type )

Create map get by key list operation. Server selects map items identified by keys and returns selected data specified by return_type.

This function takes ownership and frees heap memory associated with keys parameter.

◆ as_operations_map_get_by_key_range()

AS_EXTERN bool as_operations_map_get_by_key_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * begin,
as_val * end,
as_map_return_type return_type )

Create map get by key range operation. Server selects map items identified by key range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns selected data specified by return_type.

This function takes ownership and frees heap memory associated with begin/end parameters.

◆ as_operations_map_get_by_key_rel_index_range()

AS_EXTERN bool as_operations_map_get_by_key_rel_index_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * key,
int64_t index,
uint64_t count,
as_map_return_type return_type )

Create map get by key relative to index range operation. Server selects map items nearest to key and greater by index with a count limit. Server returns selected data specified by return_type.

Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index,count) = [selected items]
  • (5,0,1) = [{5=15}]
  • (5,1,2) = [{9=10}]
  • (5,-1,1) = [{4=2}]
  • (3,2,1) = [{9=10}]
  • (3,-2,2) = [{0=17}]

This function takes ownership and frees heap memory associated with key parameter.

◆ as_operations_map_get_by_key_rel_index_range_to_end()

AS_EXTERN bool as_operations_map_get_by_key_rel_index_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * key,
int64_t index,
as_map_return_type return_type )

Create map get by key relative to index range operation. Server selects map items nearest to key and greater by index. Server returns selected data specified by return_type.

Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index) = [selected items]
  • (5,0) = [{5=15},{9=10}]
  • (5,1) = [{9=10}]
  • (5,-1) = [{4=2},{5=15},{9=10}]
  • (3,2) = [{9=10}]
  • (3,-2) = [{0=17},{4=2},{5=15},{9=10}]

This function takes ownership and frees heap memory associated with key parameter.

◆ as_operations_map_get_by_rank()

AS_EXTERN bool as_operations_map_get_by_rank ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t rank,
as_map_return_type return_type )

Create map get by rank operation. Server selects map item identified by rank and returns selected data specified by return_type.

◆ as_operations_map_get_by_rank_range()

AS_EXTERN bool as_operations_map_get_by_rank_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t rank,
uint64_t count,
as_map_return_type return_type )

Create map get by rank range operation. Server selects count map items starting at specified rank and returns selected data specified by return_type.

◆ as_operations_map_get_by_rank_range_to_end()

AS_EXTERN bool as_operations_map_get_by_rank_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t rank,
as_map_return_type return_type )

Create map get by rank range operation. Server selects map items starting at specified rank to the last ranked item and returns selected data specified by return_type.

◆ as_operations_map_get_by_value()

AS_EXTERN bool as_operations_map_get_by_value ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * value,
as_map_return_type return_type )

Create map get by value operation. Server selects map items identified by value and returns selected data specified by return_type.

This function takes ownership and frees heap memory associated with value parameter.

◆ as_operations_map_get_by_value_list()

AS_EXTERN bool as_operations_map_get_by_value_list ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_list * values,
as_map_return_type return_type )

Create map get by value list operation. Server selects map items identified by values and returns selected data specified by return_type.

This function takes ownership and frees heap memory associated with values parameter.

◆ as_operations_map_get_by_value_range()

AS_EXTERN bool as_operations_map_get_by_value_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * begin,
as_val * end,
as_map_return_type return_type )

Create map get by value range operation. Server selects map items identified by value range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns selected data specified by return_type.

This function takes ownership and frees heap memory associated with begin/end parameters.

◆ as_operations_map_get_by_value_rel_rank_range()

AS_EXTERN bool as_operations_map_get_by_value_rel_rank_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * value,
int64_t rank,
uint64_t count,
as_map_return_type return_type )

Create map get by value relative to rank range operation. Server selects map items nearest to value and greater by relative rank with a count limit. Server returns selected data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank,count) = [selected items]
  • (11,1,1) = [{0=17}]
  • (11,-1,1) = [{9=10}]

This function takes ownership and frees heap memory associated with value parameter.

◆ as_operations_map_get_by_value_rel_rank_range_to_end()

AS_EXTERN bool as_operations_map_get_by_value_rel_rank_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * value,
int64_t rank,
as_map_return_type return_type )

Create map get by value relative to rank range operation. Server selects map items nearest to value and greater by relative rank. Server returns selected data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank) = [selected items]
  • (11,1) = [{0=17}]
  • (11,-1) = [{9=10},{5=15},{0=17}]

This function takes ownership and frees heap memory associated with value parameter.

◆ as_operations_map_increment()

AS_EXTERN bool as_operations_map_increment ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_policy * policy,
as_val * key,
as_val * value )

Create map increment operation. Server increments values by incr for all items identified by key and returns final result. Valid only for numbers.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

This function takes ownership and frees heap memory associated with key/value parameters.

◆ as_operations_map_put()

AS_EXTERN bool as_operations_map_put ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_policy * policy,
as_val * key,
as_val * value )

Create map put operation. Server writes key/value item to map bin and returns map size.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

This function takes ownership and frees heap memory associated with key/value parameters.

◆ as_operations_map_put_items()

AS_EXTERN bool as_operations_map_put_items ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_policy * policy,
as_map * items )

Create map put items operation. Server writes each map item to map bin and returns map size.

The required map policy dictates the type of map to create when it does not exist. The map policy also specifies the mode used when writing items to the map. See as_map_policy and as_map_write_mode.

This function takes ownership and frees heap memory associated with items parameter.

◆ as_operations_map_remove_by_index()

AS_EXTERN bool as_operations_map_remove_by_index ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t index,
as_map_return_type return_type )

Create map remove operation. Server removes map item identified by index and returns removed data specified by return_type.

◆ as_operations_map_remove_by_index_range()

AS_EXTERN bool as_operations_map_remove_by_index_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t index,
uint64_t count,
as_map_return_type return_type )

Create map remove operation. Server removes count map items starting at specified index and returns removed data specified by return_type.

◆ as_operations_map_remove_by_index_range_to_end()

AS_EXTERN bool as_operations_map_remove_by_index_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t index,
as_map_return_type return_type )

Create map remove operation. Server removes map items starting at specified index to the end of map and returns removed data specified by return_type.

◆ as_operations_map_remove_by_key()

AS_EXTERN bool as_operations_map_remove_by_key ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * key,
as_map_return_type return_type )

Create map remove operation. Server removes map item identified by key and returns removed data specified by return_type.

This function takes ownership and frees heap memory associated with key parameter.

◆ as_operations_map_remove_by_key_list()

AS_EXTERN bool as_operations_map_remove_by_key_list ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_list * keys,
as_map_return_type return_type )

Create map remove operation. Server removes map items identified by keys and returns removed data specified by return_type.

This function takes ownership and frees heap memory associated with keys parameter.

◆ as_operations_map_remove_by_key_range()

AS_EXTERN bool as_operations_map_remove_by_key_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * begin,
as_val * end,
as_map_return_type return_type )

Create map remove operation. Server removes map items identified by key range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns removed data specified by return_type.

This function takes ownership and frees heap memory associated with begin/end parameters.

◆ as_operations_map_remove_by_key_rel_index_range()

AS_EXTERN bool as_operations_map_remove_by_key_rel_index_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * key,
int64_t index,
uint64_t count,
as_map_return_type return_type )

Create map remove by key relative to index range operation. Server removes map items nearest to key and greater by index with a count limit. Server returns removed data specified by return_type.

Examples for map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index,count) = [removed items]
  • (5,0,1) = [{5=15}]
  • (5,1,2) = [{9=10}]
  • (5,-1,1) = [{4=2}]
  • (3,2,1) = [{9=10}]
  • (3,-2,2) = [{0=17}]

This function takes ownership and frees heap memory associated with key parameter.

◆ as_operations_map_remove_by_key_rel_index_range_to_end()

AS_EXTERN bool as_operations_map_remove_by_key_rel_index_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * key,
int64_t index,
as_map_return_type return_type )

Create map remove by key relative to index range operation. Server removes map items nearest to key and greater by index. Server returns removed data specified by return_type.

Examples for map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index) = [removed items]
  • (5,0) = [{5=15},{9=10}]
  • (5,1) = [{9=10}]
  • (5,-1) = [{4=2},{5=15},{9=10}]
  • (3,2) = [{9=10}]
  • (3,-2) = [{0=17},{4=2},{5=15},{9=10}]

This function takes ownership and frees heap memory associated with key parameter.

◆ as_operations_map_remove_by_rank()

AS_EXTERN bool as_operations_map_remove_by_rank ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t rank,
as_map_return_type return_type )

Create map remove operation. Server removes map item identified by rank and returns removed data specified by return_type.

◆ as_operations_map_remove_by_rank_range()

AS_EXTERN bool as_operations_map_remove_by_rank_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t rank,
uint64_t count,
as_map_return_type return_type )

Create map remove operation. Server removes count map items starting at specified rank and returns removed data specified by return_type.

◆ as_operations_map_remove_by_rank_range_to_end()

AS_EXTERN bool as_operations_map_remove_by_rank_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
int64_t rank,
as_map_return_type return_type )

Create map remove operation. Server removes map items starting at specified rank to the last ranked item and returns removed data specified by return_type.

◆ as_operations_map_remove_by_value()

AS_EXTERN bool as_operations_map_remove_by_value ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * value,
as_map_return_type return_type )

Create map remove operation. Server removes map items identified by value and returns removed data specified by return_type.

This function takes ownership and frees heap memory associated with value parameter.

◆ as_operations_map_remove_by_value_list()

AS_EXTERN bool as_operations_map_remove_by_value_list ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_list * values,
as_map_return_type return_type )

Create map remove operation. Server removes map items identified by values and returns removed data specified by return_type.

This function takes ownership and frees heap memory associated with values parameter.

◆ as_operations_map_remove_by_value_range()

AS_EXTERN bool as_operations_map_remove_by_value_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * begin,
as_val * end,
as_map_return_type return_type )

Create map remove operation. Server removes map items identified by value range (begin inclusive, end exclusive). If begin is null, the range is less than end. If end is null, the range is greater than equal to begin.

Server returns removed data specified by return_type.

This function takes ownership and frees heap memory associated with begin/end parameters.

◆ as_operations_map_remove_by_value_rel_rank_range()

AS_EXTERN bool as_operations_map_remove_by_value_rel_rank_range ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * value,
int64_t rank,
uint64_t count,
as_map_return_type return_type )

Create map remove by value relative to rank range operation. Server removes map items nearest to value and greater by relative rank with a count limit. Server returns removed data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank,count) = [removed items]
  • (11,1,1) = [{0=17}]
  • (11,-1,1) = [{9=10}]

This function takes ownership and frees heap memory associated with value parameter.

◆ as_operations_map_remove_by_value_rel_rank_range_to_end()

AS_EXTERN bool as_operations_map_remove_by_value_rel_rank_range_to_end ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_val * value,
int64_t rank,
as_map_return_type return_type )

Create map remove by value relative to rank range operation. Server removes map items nearest to value and greater by relative rank. Server returns removed data specified by return_type.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank) = [removed items]
  • (11,1) = [{0=17}]
  • (11,-1) = [{9=10},{5=15},{0=17}]

This function takes ownership and frees heap memory associated with value parameter.

◆ as_operations_map_set_policy()

AS_EXTERN bool as_operations_map_set_policy ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx,
as_map_policy * policy )

Create set map policy operation. Server sets map policy attributes. Server does not return a value.

◆ as_operations_map_size()

AS_EXTERN bool as_operations_map_size ( as_operations * ops,
const char * name,
as_cdt_ctx * ctx )

Create map size operation. Server returns size of map.