ListExp Class

List expression generator. See Exp.

The bin expression argument in these methods can be a reference to a bin or the result of another expression. Expressions that modify bin values are only used for temporary expression evaluation and are not permanently applied to the bin.

List modify expressions return the bin's value. This value will be a list except when the list is nested within a map. In that case, a map is returned for the list modify expression.

List expressions 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:

  • Index 0: First item in list.
  • Index 4: Fifth item in list.
  • Index -1: Last item in list.
  • Index -3: Third to last item in list.
  • Index 1 Count 2: Second and third items in list.
  • Index -3 Count 3: Last three items in list.
  • Index -5 Count 4: Range between fifth to last item to second to last item inclusive.

Nested expressions are supported by optional CTX context arguments. Example:

  • bin = [[7,9,5],[1,2,3],[6,5,4,1]]
  • Get size of last list.
  • ListExp.size(Exp.ListBin("bin"), CTX.listIndex(-1))
  • result = 4

Definition

Namespace: Aerospike.Client
Assembly: AerospikeClient (in AerospikeClient.dll) Version: 7.0.1
C#
public sealed class ListExp
Inheritance
Object    ListExp

Constructors

ListExpInitializes a new instance of the ListExp class

Methods

Append Create expression that appends list items to end of list.
AppendItems Create expression that appends list items to end of list.
Clear Create expression that removes all items in list.
GetByIndex Create expression that selects list item identified by index and returns selected data specified by returnType.
GetByIndexRange(ListReturnType, Exp, Exp, CTX) Create expression that selects list items starting at specified index to the end of list and returns selected data specified by returnType.
GetByIndexRange(ListReturnType, Exp, Exp, Exp, CTX) Create expression that selects "count" list items starting at specified index and returns selected data specified by returnType.
GetByRank Create expression that selects list item identified by rank and returns selected data specified by returnType.
GetByRankRange(ListReturnType, Exp, Exp, CTX) Create expression that selects list items starting at specified rank to the last ranked item and returns selected data specified by returnType.
GetByRankRange(ListReturnType, Exp, Exp, Exp, CTX) Create expression that selects "count" list items starting at specified rank and returns selected data specified by returnType.
GetByValue Create expression that selects list items identified by value and returns selected data specified by returnType.
GetByValueList Create expression that selects list items identified by values and returns selected data specified by returnType.
GetByValueRange Create expression that selects list items identified by value range and returns selected data specified by returnType.
GetByValueRelativeRankRange(ListReturnType, Exp, Exp, Exp, CTX) Create expression that selects list items nearest to value and greater by relative rank and returns selected data specified by returnType.

Examples for ordered list [0,4,5,9,11,15]:

  • (value,rank) = [selected items]
  • (5,0) = [5,9,11,15]
  • (5,1) = [9,11,15]
  • (5,-1) = [4,5,9,11,15]
  • (3,0) = [4,5,9,11,15]
  • (3,3) = [11,15]
  • (3,-3) = [0,4,5,9,11,15]

GetByValueRelativeRankRange(ListReturnType, Exp, Exp, Exp, Exp, CTX) Create expression that selects list items nearest to value and greater by relative rank with a count limit and returns selected data specified by returnType.

Examples for ordered list [0,4,5,9,11,15]:

  • (value,rank,count) = [selected items]
  • (5,0,2) = [5,9]
  • (5,1,1) = [9]
  • (5,-1,2) = [4,5]
  • (3,0,1) = [4]
  • (3,3,7) = [11,15]
  • (3,-3,2) = []

Increment Create expression that increments list[index] by value. Value expression should resolve to a number.
Insert Create expression that inserts value to specified index of list.
InsertItems Create expression that inserts each input list item starting at specified index of list.
RemoveByIndex Create expression that removes list item identified by index.
RemoveByIndexRange(Int32, Exp, Exp, CTX) Create expression that removes list items starting at specified index to the end of list. Valid returnType values are NONE or INVERTED
RemoveByIndexRange(Int32, Exp, Exp, Exp, CTX) Create expression that removes "count" list items starting at specified index. Valid returnType values are NONE or INVERTED
RemoveByRank Create expression that removes list item identified by rank.
RemoveByRankRange(Int32, Exp, Exp, CTX) Create expression that removes list items starting at specified rank to the last ranked item. Valid returnType values are NONE or INVERTED
RemoveByRankRange(Int32, Exp, Exp, Exp, CTX) Create expression that removes "count" list items starting at specified rank. Valid returnType values are NONE or INVERTED
RemoveByValue Create expression that removes list items identified by value. Valid returnType values are NONE or INVERTED
RemoveByValueList Create expression that removes list items identified by values. Valid returnType values are NONE or INVERTED
RemoveByValueRange Create expression that removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). If valueBegin is null, the range is less than valueEnd. If valueEnd is null, the range is greater than equal to valueBegin. Valid returnType values are NONE or INVERTED
RemoveByValueRelativeRankRange(Int32, Exp, Exp, Exp, CTX) Create expression that removes list items nearest to value and greater by relative rank. Valid returnType values are NONE or INVERTED

Examples for ordered list [0,4,5,9,11,15]:

  • (value,rank) = [removed items]
  • (5,0) = [5,9,11,15]
  • (5,1) = [9,11,15]
  • (5,-1) = [4,5,9,11,15]
  • (3,0) = [4,5,9,11,15]
  • (3,3) = [11,15]
  • (3,-3) = [0,4,5,9,11,15]

RemoveByValueRelativeRankRange(Int32, Exp, Exp, Exp, Exp, CTX) Create expression that removes list items nearest to value and greater by relative rank with a count limit. Valid returnType values are NONE or INVERTED

Examples for ordered list [0,4,5,9,11,15]:

  • (value,rank,count) = [removed items]
  • (5,0,2) = [5,9]
  • (5,1,1) = [9]
  • (5,-1,2) = [4,5]
  • (3,0,1) = [4]
  • (3,3,7) = [11,15]
  • (3,-3,2) = []

Set Create expression that sets item value at specified index in list.
Size Create expression that returns list size.
Sort Create expression that sorts list according to sortFlags.

See Also