Skip to content
Webinar - April 23: Breaking the trade-off: ACID transactions at scaleRegister now

List bin operations

Aerospike list bin expressions enable you to manipulate list-type bins directly in queries.

This guide covers operations like append, insert, remove, set, and increment, allowing you to read or modify lists efficiently.

Modify

list_append
list_append(context, policy, value, bin)
Description

Append value to list bin. list_append does not create a new bin if the specified bin does not exist, unlike the append CDT List operation, which does create a new bin if the specified bin does not exist.

Arguments
NameType
context library_specific
policy library_specific
value expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_append_items
list_append_items(context, policy, values, bin)
Description

Append all elements in values to list bin.

Arguments
NameType
context library_specific
policy library_specific
values list_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_clear
list_clear(context, bin)
Description

Clear all elements in list bin.

Arguments
NameType
context library_specific
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_increment
list_increment(context, policy, index, delta, bin)
Description

Increment element at index by delta.

Arguments
NameType
context library_specific
policy library_specific
index integer_expr
delta integer_expr
bin list_bin_expr
Returns
list_bin
list_insert
list_insert(context, policy, index, value, bin)
Description

Insert value at index.

Arguments
NameType
context library_specific
policy library_specific
index integer_expr
value expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_insert_items
list_insert_items(context, policy, index, values, bin)
Description

Insert all elements in values at index.

Arguments
NameType
context library_specific
policy library_specific
index integer_expr
values list_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_index
list_remove_by_index(context, index, bin)
Description

Remove element at index.

Arguments
NameType
context library_specific
index integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_index_range
list_remove_by_index_range(context, index, count, bin)
Description

Remove count element at index.

Arguments
NameType
context library_specific
index integer_expr
count integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_index_range_to_end
list_remove_by_index_range_to_end(context, index, bin)
Description

Remove all elements at and after index.

Arguments
NameType
context library_specific
index integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_rank
list_remove_by_rank(context, rank, bin)
Description

Remove all element with rank rank.

Arguments
NameType
context library_specific
rank integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_rank_range
list_remove_by_rank_range(context, rank, count, bin)
Description

Remove count element at rank.

Arguments
NameType
context library_specific
rank integer_expr
count integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_rank_range_to_end
list_remove_by_rank_range_to_end(context, rank, bin)
Description

Remove all elements at and after rank.

Arguments
NameType
context library_specific
rank integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_rel_rank_range
list_remove_by_rel_rank_range(context, value, rank, count, bin)
Description

Remove count element at rank relative to value.

Arguments
NameType
context library_specific
value expr
rank integer_expr
count integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_rel_rank_range_to_end
list_remove_by_rel_rank_range_to_end(context, value, rank, bin)
Description

Remove all elements at and after rank relative to value.

Arguments
NameType
context library_specific
value expr
rank integer_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_value
list_remove_by_value(context, value, bin)
Description

Remove all value values from list.

Arguments
NameType
context library_specific
value expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_value_list
list_remove_by_value_list(context, value, bin)
Description

Remove all elements with values in value_list from list.

Arguments
NameType
context library_specific
value list_expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_remove_by_value_range
list_remove_by_value_range(context, start, end, bin)
Description

Remove all elements x in interval start ≤ x < end from list.

Arguments
NameType
context library_specific
start expr
end expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_set
list_set(context, index, value, bin)
Description

Set element at index to value.

Arguments
NameType
context library_specific
index integer-expr
value expr
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4
list_sort
list_sort(context, flag, bin)
Description

Sort list.

Arguments
NameType
context library_specific
flag integer
bin list_bin_expr
Returns
list_bin
Introduced
5.2.0.4

Read

list_get_by_index
list_get_by_index(type, context, result_type, index, bin)
Description

Get element at index.

Arguments
NameType
type integer_value
context library_specific
result_type integer_value
index integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_index_range
list_get_by_index_range(context, result_type, index, count, bin)
Description

Get count elements at index.

Arguments
NameType
context library_specific
result_type integer_value
index integer_expr
count integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_index_range_to_end
list_get_by_index_range_to_end(context, result_type, index, bin)
Description

Get elements at and after index.

Arguments
NameType
context library_specific
result_type integer_value
index integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_rank
list_get_by_rank(type, context, result_type, rank, bin)
Description

Get element at rank.

Arguments
NameType
type integer_value
context library_specific
result_type integer_value
rank integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_rank_range
list_get_by_rank_range(context, result_type, rank, count, bin)
Description

Get count elements at rank.

Arguments
NameType
context library_specific
result_type integer_value
rank integer_expr
count integer_expr
bin list_bin_expr
list_get_by_rank_range_to_end
list_get_by_rank_range_to_end(context, result_type, rank, bin)
Description

Get elements at and after rank.

Arguments
NameType
context library_specific
result_type integer_value
rank integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_rel_rank_range
list_get_by_rel_rank_range(context, result_type, value, rank, count, bin)
Description

Get count element at rank relative to value.

Arguments
NameType
context library_specific
result_type integer_value
value expr
rank integer_expr
count integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_rel_rank_range_to_end
list_get_by_rel_rank_range_to_end(context, result_type, value, rank, bin)
Description

Get all elements at and after rank relative to value.

Arguments
NameType
context library_specific
result_type integer_value
value expr
rank integer_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_value
list_get_by_value(context, result_type, value, bin)
Description

Get all value values from list.

Arguments
NameType
context library_specific
result_type integer_value
value expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_value_list
list_get_by_value_list(context, result_type, values, bin)
Description

Get all elements with values in values from list.

Arguments
NameType
context library_specific
result_type integer_value
values list_expr
bin list_bin_expr
Introduced
5.2.0.4
list_get_by_value_range
list_get_by_value_range(context, result_type, start, end, bin)
Description

Get all elements x in interval start ≤ x < end from list.

Arguments
NameType
context library_specific
result_type integer_value
start expr
end expr
bin list_bin_expr
Introduced
5.2.0.4
list_size
list_size(context, bin)
Description

Get list element count.

Arguments
NameType
context library_specific
bin list_bin_expr
Returns
integer_bin
Introduced
5.2.0.4
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?