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:
Nested CDT operations are supported by optional context (as_cdt_ctx):
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 } |
enum 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.
enum 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 ops;
as_operations_inita(&ops, 1);
as_record* rec = NULL;
as_status status = aerospike_key_operate(as, &err, NULL, &key, &ops, &rec);
as_operations_destroy(&ops);
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) Definition as_map_operations.h:1146 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.
enum as_map_write_flags |
Map write bit flags. Requires server versions >= 4.3.
Definition at line 153 of file as_map_operations.h.
enum 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.
Definition at line 127 of file as_map_operations.h.
AS_EXTERN void as_map_policy_init | ( | as_map_policy * | policy | ) |
Initialize map attributes to default unordered map with standard overwrite semantics.
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_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.
policy | Target map policy. |
order | Map order. |
flags | Map write flags. See as_map_write_flags. |
persist_index | If 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_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).
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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}]:
Definition at line 1496 of file as_map_operations.h.
References as_operations_map_get_by_key_rel_index_range().
|
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}]:
Definition at line 1469 of file as_map_operations.h.
References as_operations_map_get_by_key_rel_index_range_to_end().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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}]:
Definition at line 1591 of file as_map_operations.h.
References as_operations_map_get_by_value_rel_rank_range().
|
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}]:
Definition at line 1567 of file as_map_operations.h.
References as_operations_map_get_by_value_rel_rank_range_to_end().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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}]:
Definition at line 1198 of file as_map_operations.h.
References as_operations_map_remove_by_key_rel_index_range().
|
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}]:
Definition at line 1172 of file as_map_operations.h.
References as_operations_map_remove_by_key_rel_index_range_to_end().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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}]:
Definition at line 1293 of file as_map_operations.h.
References as_operations_map_remove_by_value_rel_rank_range().
|
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}]:
Definition at line 1269 of file as_map_operations.h.
References as_operations_map_remove_by_value_rel_rank_range_to_end().
|
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().
|
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_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.
ops | Target operations list. |
name | Bin name. |
ctx | Optional path to nested list. If not defined, the top-level list is used. |
order | List order. |
pad | If 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_index | If 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_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_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_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.
ops | Target operations list. |
name | Bin name. |
ctx | Optional path to nested map. If not defined, the top-level map is used. |
order | Map order. |
persist_index | If 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_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.
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_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_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_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_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_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_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}]:
This function takes ownership and frees heap memory associated with key parameter.
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}]:
This function takes ownership and frees heap memory associated with key parameter.
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_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_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_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_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_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_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}]:
This function takes ownership and frees heap memory associated with value parameter.
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}]:
This function takes ownership and frees heap memory associated with value parameter.
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_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_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_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_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_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_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_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_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_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}]:
This function takes ownership and frees heap memory associated with key parameter.
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}]:
This function takes ownership and frees heap memory associated with key parameter.
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_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_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_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_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_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_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}]:
This function takes ownership and frees heap memory associated with value parameter.
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}]:
This function takes ownership and frees heap memory associated with value parameter.
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_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.