![]() |
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);
static bool as_operations_add_list_remove_by_index_range(as_operations *ops, const char *name, int64_t index, uint64_t count, as_list_return_type return_type) Definition as_list_operations.h:1642 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 942 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 985 of file as_list_operations.h.
References 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 970 of file as_list_operations.h.
References 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 1070 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 1083 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 1055 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 1036 of file as_list_operations.h.
References 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 1021 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 1002 of file as_list_operations.h.
References as_operations_list_append(), and as_string_init().
|
inlinestatic |
Create list append operation with policy. Server appends value to list bin. Server returns list size.
Definition at line 955 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 1718 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 1745 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 1886 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 1916 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 1901 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 1931 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 1961 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 1946 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 1783 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 1816 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 1801 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 1870 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 1842 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 1757 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 1771 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 1266 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 1281 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 1098 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 1145 of file as_list_operations.h.
References 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 1128 of file as_list_operations.h.
References 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 1235 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 1250 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 1220 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 1200 of file as_list_operations.h.
References 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 1183 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 1164 of file as_list_operations.h.
References as_operations_list_insert(), and 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 1113 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 1430 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 1442 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 1457 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 1470 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 1613 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 1642 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 1628 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 1657 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 1686 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 1672 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 1510 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 1524 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 1542 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 1597 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 1569 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 1483 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 1498 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 1296 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 1341 of file as_list_operations.h.
References 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 1324 of file as_list_operations.h.
References as_integer_init(), and as_operations_list_set().
|
inlinestatic |
Create set list order operation. Server sets list order. Server returns null.
Definition at line 915 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 1416 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 1396 of file as_list_operations.h.
References 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 1379 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 1360 of file as_list_operations.h.
References as_operations_list_set(), and 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 1309 of file as_list_operations.h.
References as_operations_list_set().
|
inlinestatic |
Create list size operation. Server returns size of list.
Definition at line 1733 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 929 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 1703 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.