List bin operations. Create list operations used by client operate command.
List operations support negative indexing. If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. If a range is partially out of bounds, the valid part of the range will be returned. Index/Range examples:
Example 1:
Nested CDT operations are supported by optional context (as_cdt_ctx). Example:
Data Structures | |
struct | as_list_policy |
Enumerations | |
enum | as_list_order { AS_LIST_UNORDERED = 0, AS_LIST_ORDERED = 1 } |
enum | as_list_return_type { AS_LIST_RETURN_NONE = 0, AS_LIST_RETURN_INDEX = 1, AS_LIST_RETURN_REVERSE_INDEX = 2, AS_LIST_RETURN_RANK = 3, AS_LIST_RETURN_REVERSE_RANK = 4, AS_LIST_RETURN_COUNT = 5, AS_LIST_RETURN_VALUE = 7, AS_LIST_RETURN_EXISTS = 13, AS_LIST_RETURN_INVERTED = 0x10000 } |
enum | as_list_sort_flags { AS_LIST_SORT_DEFAULT = 0, AS_LIST_SORT_DROP_DUPLICATES = 2 } |
enum | as_list_write_flags { AS_LIST_WRITE_DEFAULT = 0, AS_LIST_WRITE_ADD_UNIQUE = 1, AS_LIST_WRITE_INSERT_BOUNDED = 2, AS_LIST_WRITE_NO_FAIL = 4, AS_LIST_WRITE_PARTIAL = 8 } |
enum as_list_order |
List storage order.
Enumerator | |
---|---|
AS_LIST_UNORDERED |
List is not ordered. This is the default. |
AS_LIST_ORDERED |
List is ordered. |
Definition at line 34 of file as_cdt_order.h.
enum as_list_return_type |
List return type. Type of data to return when selecting or removing items from the list.
Enumerator | |
---|---|
AS_LIST_RETURN_NONE |
Do not return a result. |
AS_LIST_RETURN_INDEX |
Return key index order. |
AS_LIST_RETURN_REVERSE_INDEX |
Return reverse key order. |
AS_LIST_RETURN_RANK |
Return value order. |
AS_LIST_RETURN_REVERSE_RANK |
Return reverse value order. |
AS_LIST_RETURN_COUNT |
Return count of items selected. |
AS_LIST_RETURN_VALUE |
Return value for single key read and value list for range read. |
AS_LIST_RETURN_EXISTS |
Return true if count > 0. |
AS_LIST_RETURN_INVERTED |
Invert meaning of list command and return values. For example: as_operations ops;
as_operations_inita(&ops, 1);
as_operations_add_list_remove_by_index_range(&ops, BIN_NAME, index, count,
as_record* rec = NULL;
as_status status = aerospike_key_operate(as, &err, NULL, &key, &ops, &rec);
as_operations_destroy(&ops);
With AS_LIST_RETURN_INVERTED enabled, the items outside of the specified index range will be removed and returned. |
Definition at line 162 of file as_list_operations.h.
enum as_list_sort_flags |
List sort flags.
Enumerator | |
---|---|
AS_LIST_SORT_DEFAULT |
Default. Preserve duplicate values when sorting list. |
AS_LIST_SORT_DROP_DUPLICATES |
Drop duplicate values when sorting list. |
Definition at line 101 of file as_list_operations.h.
enum as_list_write_flags |
List write bit flags.
Definition at line 118 of file as_list_operations.h.
|
inlinestatic |
Initialize list attributes to default unordered list with standard overwrite semantics.
Definition at line 274 of file as_list_operations.h.
References AS_LIST_UNORDERED, AS_LIST_WRITE_DEFAULT, as_list_policy::flags, and as_list_policy::order.
|
inlinestatic |
Set list attributes to specified list order and write flag semantics.
Definition at line 286 of file as_list_operations.h.
References as_list_policy::flags, and as_list_policy::order.
|
inlinestatic |
Create list append operation. Server appends value to list bin. Server returns list size.
Definition at line 921 of file as_list_operations.h.
References as_operations_list_append().
|
inlinestatic |
Create list append operation. Server appends double to list bin. Server returns list size.
Definition at line 964 of file as_list_operations.h.
References as_double::as_double_init(), and as_operations_list_append().
|
inlinestatic |
Create list append operation. Server appends integer to list bin. Server returns list size.
Definition at line 949 of file as_list_operations.h.
References as_integer::as_integer_init(), and as_operations_list_append().
|
inlinestatic |
Create list append items operation. Server appends each input list item to end of list bin. Server returns list size.
Definition at line 1049 of file as_list_operations.h.
References as_operations_list_append_items().
|
inlinestatic |
Create list append items operation with policy. Server appends each input list item to end of list bin. Server returns list size.
Definition at line 1062 of file as_list_operations.h.
References as_operations_list_append_items().
|
inlinestatic |
Create list append operation. Server appends blob (byte array) to list bin. Server returns list size.
The value will not be freed when the operations are destroyed.
Definition at line 1034 of file as_list_operations.h.
References as_operations_add_list_append_rawp().
|
inlinestatic |
Create list append operation. Server appends blob (byte array) to list bin. Server returns list size.
If free is true, the value will be freed when the operations are destroyed.
Definition at line 1015 of file as_list_operations.h.
References as_bytes::as_bytes_init_wrap(), and as_operations_list_append().
|
inlinestatic |
Create list append operation. Server appends string to list bin. Server returns list size.
The value will not be freed when the operations are destroyed.
Definition at line 1000 of file as_list_operations.h.
References as_operations_add_list_append_strp().
|
inlinestatic |
Create list append operation. Server appends string to list bin. Server returns list size.
If free is true, the value will be freed when the operations are destroyed.
Definition at line 981 of file as_list_operations.h.
References as_operations_list_append(), and as_string::as_string_init().
|
inlinestatic |
Create list append operation with policy. Server appends value to list bin. Server returns list size.
Definition at line 934 of file as_list_operations.h.
References as_operations_list_append().
|
inlinestatic |
Create list clear operation. Server removes all items in list bin. Server does not return a result by default.
Definition at line 1697 of file as_list_operations.h.
References as_operations_list_clear().
|
inlinestatic |
Create list get operation. Server returns item at specified index in list bin.
Definition at line 1724 of file as_list_operations.h.
References as_operations_list_get().
|
inlinestatic |
Create list get by index operation. Server selects list item identified by index and returns selected data specified by return_type.
Definition at line 1865 of file as_list_operations.h.
References as_operations_list_get_by_index().
|
inlinestatic |
Create list get by index range operation. Server selects count
list items starting at specified index and returns selected data specified by return_type.
Definition at line 1895 of file as_list_operations.h.
References as_operations_list_get_by_index_range().
|
inlinestatic |
Create list get by index range operation. Server selects list items starting at specified index to the end of list and returns selected data specified by return_type.
Definition at line 1880 of file as_list_operations.h.
References as_operations_list_get_by_index_range_to_end().
|
inlinestatic |
Create list get by rank operation. Server selects list item identified by rank and returns selected data specified by return_type.
Definition at line 1910 of file as_list_operations.h.
References as_operations_list_get_by_rank().
|
inlinestatic |
Create list get by rank range operation. Server selects count
list items starting at specified rank and returns selected data specified by return_type.
Definition at line 1940 of file as_list_operations.h.
References as_operations_list_get_by_rank_range().
|
inlinestatic |
Create list get by rank range operation. Server selects list items starting at specified rank to the last ranked item and returns selected data specified by return_type.
Definition at line 1925 of file as_list_operations.h.
References as_operations_list_get_by_rank_range_to_end().
|
inlinestatic |
Create list get by value operation. Server selects list items identified by value and returns selected data specified by return_type.
Definition at line 1762 of file as_list_operations.h.
References as_operations_list_get_by_value().
|
inlinestatic |
Create list get by value list operation. Server selects list items identified by values and returns selected data specified by return_type.
Definition at line 1795 of file as_list_operations.h.
References as_operations_list_get_by_value_list().
|
inlinestatic |
Create list get by value range operation. Server selects list 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 1780 of file as_list_operations.h.
References as_operations_list_get_by_value_range().
|
inlinestatic |
Create list get by value relative to rank range operation. Server selects list items nearest to value and greater by relative rank with a count limit. Server returns selected data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
Definition at line 1849 of file as_list_operations.h.
References as_operations_list_get_by_value_rel_rank_range().
|
inlinestatic |
Create list get by value relative to rank range operation. Server selects list items nearest to value and greater by relative rank. Server returns selected data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
Definition at line 1821 of file as_list_operations.h.
References as_operations_list_get_by_value_rel_rank_range_to_end().
|
inlinestatic |
Create list get range operation. Server returns "count" items starting at specified index in list bin.
Definition at line 1736 of file as_list_operations.h.
References as_operations_list_get_range().
|
inlinestatic |
Create list get range operation. Server returns items starting at index to the end of list.
Definition at line 1750 of file as_list_operations.h.
References as_operations_list_get_range_from().
|
inlinestatic |
Create list increment operation. Server increments value at index by incr and returns final result. Valid only for numbers.
Definition at line 1245 of file as_list_operations.h.
References as_operations_list_increment().
|
inlinestatic |
Create list increment operation with policy. Server increments value at index by incr and returns final result. Valid only for numbers.
Definition at line 1260 of file as_list_operations.h.
References as_operations_list_increment().
|
inlinestatic |
Create default list insert operation. Server inserts value to specified index of list bin. Server returns list size.
Definition at line 1077 of file as_list_operations.h.
References as_operations_list_insert().
|
inlinestatic |
Create default list insert operation with policy. Server inserts double to specified index of list bin. Server returns list size.
Definition at line 1124 of file as_list_operations.h.
References as_double::as_double_init(), and as_operations_list_insert().
|
inlinestatic |
Create default list insert operation with policy. Server inserts integer to specified index of list bin. Server returns list size.
Definition at line 1107 of file as_list_operations.h.
References as_integer::as_integer_init(), and as_operations_list_insert().
|
inlinestatic |
Create default list insert items operation. Server inserts each input list item starting at specified index of list bin. Server returns list size.
Definition at line 1214 of file as_list_operations.h.
References as_operations_list_insert_items().
|
inlinestatic |
Create default list insert items operation with policy. Server inserts each input list item starting at specified index of list bin. Server returns list size.
Definition at line 1229 of file as_list_operations.h.
References as_operations_list_insert_items().
|
inlinestatic |
Create default list insert operation with policy. Server inserts blob (byte array) to specified index of list bin. Server returns list size.
The value will not be freed when the operations are destroyed.
Definition at line 1199 of file as_list_operations.h.
References as_operations_add_list_insert_rawp().
|
inlinestatic |
Create default list insert operation with policy. Server inserts blob (byte array) to specified index of list bin. Server returns list size.
If free is true, the value will be freed when the operations are destroyed.
Definition at line 1179 of file as_list_operations.h.
References as_bytes::as_bytes_init_wrap(), and as_operations_list_insert().
|
inlinestatic |
Create default list insert operation with policy. Server inserts string to specified index of list bin. Server returns list size.
The value will not be freed when the operations are destroyed.
Definition at line 1162 of file as_list_operations.h.
References as_operations_add_list_insert_strp().
|
inlinestatic |
Create default list insert operation with policy. Server inserts string to specified index of list bin. Server returns list size.
If free is true, the value will be freed when the operations are destroyed.
Definition at line 1143 of file as_list_operations.h.
References as_operations_list_insert(), and as_string::as_string_init().
|
inlinestatic |
Create default list insert operation with policy. Server inserts value to specified index of list bin. Server returns list size.
Definition at line 1092 of file as_list_operations.h.
References as_operations_list_insert().
|
inlinestatic |
Create list pop operation. Server returns item at specified index and removes item from list bin.
Definition at line 1409 of file as_list_operations.h.
References as_operations_list_pop().
|
inlinestatic |
Create list pop range operation. Server returns "count" items starting at specified index and removes items from list bin.
Definition at line 1421 of file as_list_operations.h.
References as_operations_list_pop_range().
|
inlinestatic |
Create list pop range operation. Server returns items starting at specified index to the end of list and removes those items from list bin.
Definition at line 1436 of file as_list_operations.h.
References as_operations_list_pop_range_from().
|
inlinestatic |
Create list remove operation. Server removes item at specified index from list bin. Server returns number of items removed.
Definition at line 1449 of file as_list_operations.h.
References as_operations_list_remove().
|
inlinestatic |
Create list remove operation. Server removes list item identified by index and returns removed data specified by return_type.
Definition at line 1592 of file as_list_operations.h.
References as_operations_list_remove_by_index().
|
inlinestatic |
Create list remove operation. Server removes count
list items starting at specified index and returns removed data specified by return_type.
Definition at line 1621 of file as_list_operations.h.
References as_operations_list_remove_by_index_range().
|
inlinestatic |
Create list remove operation. Server removes list items starting at specified index to the end of list and returns removed data specified by return_type.
Definition at line 1607 of file as_list_operations.h.
References as_operations_list_remove_by_index_range_to_end().
|
inlinestatic |
Create list remove operation. Server removes list item identified by rank and returns removed data specified by return_type.
Definition at line 1636 of file as_list_operations.h.
References as_operations_list_remove_by_rank().
|
inlinestatic |
Create list remove operation. Server removes count
list items starting at specified rank and returns removed data specified by return_type.
Definition at line 1665 of file as_list_operations.h.
References as_operations_list_remove_by_rank_range().
|
inlinestatic |
Create list remove operation. Server removes list items starting at specified rank to the last ranked item and returns removed data specified by return_type.
Definition at line 1651 of file as_list_operations.h.
References as_operations_list_remove_by_rank_range_to_end().
|
inlinestatic |
Create list remove operation. Server removes list items identified by value and returns removed data specified by return_type.
Definition at line 1489 of file as_list_operations.h.
References as_operations_list_remove_by_value().
|
inlinestatic |
Create list remove operation. Server removes list items identified by values and returns removed data specified by return_type.
Definition at line 1503 of file as_list_operations.h.
References as_operations_list_remove_by_value_list().
|
inlinestatic |
Create list remove operation. Server removes list 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 1521 of file as_list_operations.h.
References as_operations_list_remove_by_value_range().
|
inlinestatic |
Create list remove by value relative to rank range operation. Server removes list items nearest to value and greater by relative rank with a count limit. Server returns removed data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
Definition at line 1576 of file as_list_operations.h.
References as_operations_list_remove_by_value_rel_rank_range().
|
inlinestatic |
Create list remove by value relative to rank range operation. Server removes list items nearest to value and greater by relative rank. Server returns removed data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
Definition at line 1548 of file as_list_operations.h.
References as_operations_list_remove_by_value_rel_rank_range_to_end().
|
inlinestatic |
Create list remove range operation. Server removes "count" items starting at specified index from list bin. Server returns number of items removed.
Definition at line 1462 of file as_list_operations.h.
References as_operations_list_remove_range().
|
inlinestatic |
Create list remove range operation. Server removes items starting at specified index to the end of list. Server returns number of items removed.
Definition at line 1477 of file as_list_operations.h.
References as_operations_list_remove_range_from().
|
inlinestatic |
Create list set operation. Server sets item value at specified index in list bin. Server does not return a result by default.
Definition at line 1275 of file as_list_operations.h.
References as_operations_list_set().
|
inlinestatic |
Create list set operation with policy. Server sets double at specified index in list bin. Server does not return a result by default.
Definition at line 1320 of file as_list_operations.h.
References as_double::as_double_init(), and as_operations_list_set().
|
inlinestatic |
Create list set operation with policy. Server sets integer at specified index in list bin. Server does not return a result by default.
Definition at line 1303 of file as_list_operations.h.
References as_integer::as_integer_init(), and as_operations_list_set().
|
inlinestatic |
Create set list order operation. Server sets list order. Server returns null.
Definition at line 894 of file as_list_operations.h.
References as_operations_list_set_order().
|
inlinestatic |
Create list set operation with policy. Server sets blob (byte array) at specified index in list bin. Server does not return a result by default.
The value will not be freed when the operations are destroyed.
Definition at line 1395 of file as_list_operations.h.
References as_operations_add_list_set_rawp().
|
inlinestatic |
Create list set operation with policy. Server sets blob (byte array) at specified index in list bin. Server does not return a result by default.
If free is true, the value will be freed when the operations are destroyed.
Definition at line 1375 of file as_list_operations.h.
References as_bytes::as_bytes_init_wrap(), and as_operations_list_set().
|
inlinestatic |
Create list set operation with policy. Server sets string at specified index in list bin. Server does not return a result by default.
The value will not be freed when the operations are destroyed.
Definition at line 1358 of file as_list_operations.h.
References as_operations_add_list_set_strp().
|
inlinestatic |
Create list set operation with policy. Server sets string at specified index in list bin. Server does not return a result by default.
If free is true, the value will be freed when the operations are destroyed.
Definition at line 1339 of file as_list_operations.h.
References as_operations_list_set(), and as_string::as_string_init().
|
inlinestatic |
Create list set operation with policy. Server sets item value at specified index in list bin. Server does not return a result by default.
Definition at line 1288 of file as_list_operations.h.
References as_operations_list_set().
|
inlinestatic |
Create list size operation. Server returns size of list.
Definition at line 1712 of file as_list_operations.h.
References as_operations_list_size().
|
inlinestatic |
Create list sort operation. Server sorts list according to flags. Server does not return a result by default.
Definition at line 908 of file as_list_operations.h.
References as_operations_list_sort().
|
inlinestatic |
Create list trim operation. Server removes items in list bin that do not fall into range specified by index and count range. If the range is out of bounds, then all items will be removed. Server returns list size after trim.
Definition at line 1682 of file as_list_operations.h.
References as_operations_list_trim().
AS_EXTERN bool as_operations_list_append | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_policy * | policy, | ||
as_val * | val | ||
) |
Create list append operation with policy. Server appends value to list bin. Server returns list size.
This function takes ownership and frees heap memory associated with val parameter.
AS_EXTERN bool as_operations_list_append_items | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_policy * | policy, | ||
as_list * | list | ||
) |
Create list append items operation with policy. Server appends each input list item to end of list bin. Server returns list size.
This function takes ownership and frees heap memory associated with list parameter.
AS_EXTERN bool as_operations_list_clear | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx | ||
) |
Create list clear operation. Server removes all items in list bin. Server does not return a result by default.
AS_EXTERN bool as_operations_list_create | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_order | order, | ||
bool | pad | ||
) |
Create list create operation. Server creates list at given context level. The context is allowed to be beyond list boundaries only if pad is set to true. In that case, nil list entries will be inserted to satisfy the context position.
AS_EXTERN bool as_operations_list_get | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index | ||
) |
Create list get operation. Server returns item at specified index in list bin.
AS_EXTERN bool as_operations_list_get_by_index | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
as_list_return_type | return_type | ||
) |
Create list get by index operation. Server selects list item identified by index and returns selected data specified by return_type.
AS_EXTERN bool as_operations_list_get_by_index_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
uint64_t | count, | ||
as_list_return_type | return_type | ||
) |
Create list get by index range operation. Server selects count
list items starting at specified index and returns selected data specified by return_type.
AS_EXTERN bool as_operations_list_get_by_index_range_to_end | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
as_list_return_type | return_type | ||
) |
Create list get by index range operation. Server selects list items starting at specified index to the end of list and returns selected data specified by return_type.
AS_EXTERN bool as_operations_list_get_by_rank | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | rank, | ||
as_list_return_type | return_type | ||
) |
Create list get by rank operation. Server selects list item identified by rank and returns selected data specified by return_type.
AS_EXTERN bool as_operations_list_get_by_rank_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | rank, | ||
uint64_t | count, | ||
as_list_return_type | return_type | ||
) |
Create list get by rank range operation. Server selects count
list items starting at specified rank and returns selected data specified by return_type.
AS_EXTERN bool as_operations_list_get_by_rank_range_to_end | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | rank, | ||
as_list_return_type | return_type | ||
) |
Create list get by rank range operation. Server selects list items starting at specified rank to the last ranked item and returns selected data specified by return_type.
AS_EXTERN bool as_operations_list_get_by_value | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_val * | value, | ||
as_list_return_type | return_type | ||
) |
Create list get by value operation. Server selects list 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_list_get_by_value_list | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list * | values, | ||
as_list_return_type | return_type | ||
) |
Create list get by value list operation. Server selects list 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_list_get_by_value_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_val * | begin, | ||
as_val * | end, | ||
as_list_return_type | return_type | ||
) |
Create list get by value range operation. Server selects list 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_list_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_list_return_type | return_type | ||
) |
Create list get by value relative to rank range operation. Server selects list items nearest to value and greater by relative rank with a count limit. Server returns selected data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
This function takes ownership and frees heap memory associated with value parameter.
AS_EXTERN bool as_operations_list_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_list_return_type | return_type | ||
) |
Create list get by value relative to rank range operation. Server selects list items nearest to value and greater by relative rank. Server returns selected data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
This function takes ownership and frees heap memory associated with value parameter.
AS_EXTERN bool as_operations_list_get_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
uint64_t | count | ||
) |
Create list get range operation. Server returns "count" items starting at specified index in list bin.
AS_EXTERN bool as_operations_list_get_range_from | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index | ||
) |
Create list get range operation. Server returns items starting at index to the end of list.
AS_EXTERN bool as_operations_list_increment | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_policy * | policy, | ||
int64_t | index, | ||
as_val * | incr | ||
) |
Create list increment operation with policy. Server increments value at index by incr and returns final result. Valid only for numbers.
This function takes ownership and frees heap memory associated with incr parameter.
AS_EXTERN bool as_operations_list_insert | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_policy * | policy, | ||
int64_t | index, | ||
as_val * | val | ||
) |
Create default list insert operation with policy. Server inserts value to specified index of list bin. Server returns list size.
This function takes ownership and frees heap memory associated with val parameter.
AS_EXTERN bool as_operations_list_insert_items | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_policy * | policy, | ||
int64_t | index, | ||
as_list * | list | ||
) |
Create default list insert items operation with policy. Server inserts each input list item starting at specified index of list bin. Server returns list size.
This function takes ownership and frees heap memory associated with list parameter.
AS_EXTERN bool as_operations_list_pop | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index | ||
) |
Create list pop operation. Server returns item at specified index and removes item from list bin.
AS_EXTERN bool as_operations_list_pop_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
uint64_t | count | ||
) |
Create list pop range operation. Server returns "count" items starting at specified index and removes items from list bin.
AS_EXTERN bool as_operations_list_pop_range_from | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index | ||
) |
Create list pop range operation. Server returns items starting at specified index to the end of list and removes those items from list bin.
AS_EXTERN bool as_operations_list_remove | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index | ||
) |
Create list remove operation. Server removes item at specified index from list bin. Server returns number of items removed.
AS_EXTERN bool as_operations_list_remove_by_index | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list item identified by index and returns removed data specified by return_type.
AS_EXTERN bool as_operations_list_remove_by_index_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
uint64_t | count, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes count
list items starting at specified index and returns removed data specified by return_type.
AS_EXTERN bool as_operations_list_remove_by_index_range_to_end | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list items starting at specified index to the end of list and returns removed data specified by return_type.
AS_EXTERN bool as_operations_list_remove_by_rank | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | rank, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list item identified by rank and returns removed data specified by return_type.
AS_EXTERN bool as_operations_list_remove_by_rank_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | rank, | ||
uint64_t | count, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes count
list items starting at specified rank and returns removed data specified by return_type.
AS_EXTERN bool as_operations_list_remove_by_rank_range_to_end | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | rank, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list items starting at specified rank to the last ranked item and returns removed data specified by return_type.
AS_EXTERN bool as_operations_list_remove_by_value | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_val * | value, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list 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_list_remove_by_value_list | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list * | values, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list 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_list_remove_by_value_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_val * | begin, | ||
as_val * | end, | ||
as_list_return_type | return_type | ||
) |
Create list remove operation. Server removes list 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_list_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_list_return_type | return_type | ||
) |
Create list remove by value relative to rank range operation. Server removes list items nearest to value and greater by relative rank with a count limit. Server returns removed data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
This function takes ownership and frees heap memory associated with value parameter.
AS_EXTERN bool as_operations_list_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_list_return_type | return_type | ||
) |
Create list remove by value relative to rank range operation. Server removes list items nearest to value and greater by relative rank. Server returns removed data specified by return_type.
Examples for ordered list [0,4,5,9,11,15]:
This function takes ownership and frees heap memory associated with value parameter.
AS_EXTERN bool as_operations_list_remove_range | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
uint64_t | count | ||
) |
Create list remove range operation. Server removes "count" items starting at specified index from list bin. Server returns number of items removed.
AS_EXTERN bool as_operations_list_remove_range_from | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index | ||
) |
Create list remove range operation. Server removes items starting at specified index to the end of list. Server returns number of items removed.
AS_EXTERN bool as_operations_list_set | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_policy * | policy, | ||
int64_t | index, | ||
as_val * | val | ||
) |
Create list set operation with policy. Server sets item value at specified index in list bin. Server does not return a result by default.
This function takes ownership and frees heap memory associated with val parameter.
AS_EXTERN bool as_operations_list_set_order | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_order | order | ||
) |
Create set list order operation. Server sets list order. Server returns null.
AS_EXTERN bool as_operations_list_size | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx | ||
) |
Create list size operation. Server returns size of list.
AS_EXTERN bool as_operations_list_sort | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
as_list_sort_flags | flags | ||
) |
Create list sort operation. Server sorts list according to flags. Server does not return a result by default.
AS_EXTERN bool as_operations_list_trim | ( | as_operations * | ops, |
const char * | name, | ||
as_cdt_ctx * | ctx, | ||
int64_t | index, | ||
uint64_t | count | ||
) |
Create list trim operation. Server removes items in list bin that do not fall into range specified by index and count range. If the range is out of bounds, then all items will be removed. Server returns list size after trim.