MapOperation Class

Aerospike
Map bin operations. Create map operations used by the client operate command. The default unique key map is unordered.

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:

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

Rank examples:

  • Rank 0: Item with lowest value rank in map.
  • Rank 4: Fifth lowest ranked item in map.
  • Rank -1: Item with highest ranked value in map.
  • Rank -3: Item with third highest ranked value in map.
  • Rank 1 Count 2: Second and third lowest ranked items in map.
  • Rank -3 Count 3: Top three ranked items in map.

Nested CDT operations are supported by optional CTX context arguments. Examples:

  • bin = {key1={key11=9,key12=4}, key2={key21=3,key22=5}}
  • Set map value to 11 for map key "key21" inside of map key "key2".
  • MapOperation.put(MapPolicy.Default, "bin", Value.Get("key21"), Value.Get(11), CTX.mapKey(Value.Get("key2")))
  • bin result = {key1={key11=9,key12=4},key2={key21=11,key22=5}}
  • bin = {key1={key11={key111=1},key12={key121=5}}, key2={key21={"key211",7}}}
  • Set map value to 11 in map key "key121" for highest ranked map ("key12") inside of map key "key1".
  • MapOperation.put(MapPolicy.Default, "bin", Value.Get("key121"), Value.Get(11), CTX.mapKey(Value.Get("key1")), CTX.mapRank(-1))
  • bin result = {key1={key11={key111=1},key12={key121=11}}, key2={key21={"key211",7}}}

Inheritance Hierarchy

SystemObject
  Aerospike.ClientMapOperation

Namespace:  Aerospike.Client
Assembly:  AerospikeClient (in AerospikeClient.dll) Version: 5.1.1.0 (5.1.1)
Syntax

C#
public class MapOperation

The MapOperation type exposes the following members.

Constructors

  NameDescription
Public methodMapOperation
Initializes a new instance of the MapOperation class
Top
Methods

  NameDescription
Public methodStatic memberClear
Create map clear operation. Server removes all items in map. Server returns null.
Public methodStatic memberCreate
Create map create operation. Server creates map at given context level.
Public methodStatic memberDecrement Obsolete.
Create map decrement operation. Server decrements 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 policy MapPolicy and write mode MapWriteMode.

Public methodStatic memberGetByIndex
Create map get by index operation. Server selects map item identified by index and returns selected data specified by returnType.
Public methodStatic memberGetByIndexRange(String, Int32, MapReturnType, CTX)
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 returnType.
Public methodStatic memberGetByIndexRange(String, Int32, Int32, MapReturnType, CTX)
Create map get by index range operation. Server selects "count" map items starting at specified index and returns selected data specified by returnType.
Public methodStatic memberGetByKey
Create map get by key operation. Server selects map item identified by key and returns selected data specified by returnType.
Public methodStatic memberGetByKeyList
Create map get by key list operation. Server selects map items identified by keys and returns selected data specified by returnType.
Public methodStatic memberGetByKeyRange
Create map get by key range operation. Server selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). If keyBegin is null, the range is less than keyEnd. If keyEnd is null, the range is greater than equal to keyBegin.

Server returns selected data specified by returnType.

Public methodStatic memberGetByKeyRelativeIndexRange(String, Value, Int32, MapReturnType, CTX)
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 returnType.

Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index) = [selected items]
  • (5,0) = [{5=15},{9=10}]
  • (5,1) = [{9=10}]
  • (5,-1) = [{4=2},{5=15},{9=10}]
  • (3,2) = [{9=10}]
  • (3,-2) = [{0=17},{4=2},{5=15},{9=10}]

Public methodStatic memberGetByKeyRelativeIndexRange(String, Value, Int32, Int32, MapReturnType, CTX)
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 returnType.

Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index,count) = [selected items]
  • (5,0,1) = [{5=15}]
  • (5,1,2) = [{9=10}]
  • (5,-1,1) = [{4=2}]
  • (3,2,1) = [{9=10}]
  • (3,-2,2) = [{0=17}]

Public methodStatic memberGetByRank
Create map get by rank operation. Server selects map item identified by rank and returns selected data specified by returnType.
Public methodStatic memberGetByRankRange(String, Int32, MapReturnType, CTX)
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 returnType.
Public methodStatic memberGetByRankRange(String, Int32, Int32, MapReturnType, CTX)
Create map get by rank range operation. Server selects "count" map items starting at specified rank and returns selected data specified by returnType.
Public methodStatic memberGetByValue
Create map get by value operation. Server selects map items identified by value and returns selected data specified by returnType.
Public methodStatic memberGetByValueList
Create map get by value list operation. Server selects map items identified by values and returns selected data specified by returnType.
Public methodStatic memberGetByValueRange
Create map get by value range operation. Server selects map 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.

Server returns selected data specified by returnType.

Public methodStatic memberGetByValueRelativeRankRange(String, Value, Int32, MapReturnType, CTX)
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 returnType.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank) = [selected items]
  • (11,1) = [{0=17}]
  • (11,-1) = [{9=10},{5=15},{0=17}]

Public methodStatic memberGetByValueRelativeRankRange(String, Value, Int32, Int32, MapReturnType, CTX)
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 returnType.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank,count) = [selected items]
  • (11,1,1) = [{0=17}]
  • (11,-1,1) = [{9=10}]

Public methodStatic memberIncrement
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 policy MapPolicy and write mode MapWriteMode.

Public methodStatic memberPut
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 flags used when writing items to the map. See policy MapPolicy.

Public methodStatic memberPutItems
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 flags used when writing items to the map. See policy MapPolicy.

Public methodStatic memberRemoveByIndex
Create map remove operation. Server removes map item identified by index and returns removed data specified by returnType.
Public methodStatic memberRemoveByIndexRange(String, Int32, MapReturnType, CTX)
Create map remove operation. Server removes map items starting at specified index to the end of map and returns removed data specified by returnType.
Public methodStatic memberRemoveByIndexRange(String, Int32, Int32, MapReturnType, CTX)
Create map remove operation. Server removes "count" map items starting at specified index and returns removed data specified by returnType.
Public methodStatic memberRemoveByKey
Create map remove operation. Server removes map item identified by key and returns removed data specified by returnType.
Public methodStatic memberRemoveByKeyList
Create map remove operation. Server removes map items identified by keys and returns removed data specified by returnType.
Public methodStatic memberRemoveByKeyRange
Create map remove operation. Server removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). If keyBegin is null, the range is less than keyEnd. If keyEnd is null, the range is greater than equal to keyBegin.

Server returns removed data specified by returnType.

Public methodStatic memberRemoveByKeyRelativeIndexRange(String, Value, Int32, MapReturnType, CTX)
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 returnType.

Examples for map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index) = [removed items]
  • (5,0) = [{5=15},{9=10}]
  • (5,1) = [{9=10}]
  • (5,-1) = [{4=2},{5=15},{9=10}]
  • (3,2) = [{9=10}]
  • (3,-2) = [{0=17},{4=2},{5=15},{9=10}]

Public methodStatic memberRemoveByKeyRelativeIndexRange(String, Value, Int32, Int32, MapReturnType, CTX)
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 returnType.

Examples for map [{0=17},{4=2},{5=15},{9=10}]:

  • (value,index,count) = [removed items]
  • (5,0,1) = [{5=15}]
  • (5,1,2) = [{9=10}]
  • (5,-1,1) = [{4=2}]
  • (3,2,1) = [{9=10}]
  • (3,-2,2) = [{0=17}]

Public methodStatic memberRemoveByRank
Create map remove operation. Server removes map item identified by rank and returns removed data specified by returnType.
Public methodStatic memberRemoveByRankRange(String, Int32, MapReturnType, CTX)
Create map remove operation. Server removes map items starting at specified rank to the last ranked item and returns removed data specified by returnType.
Public methodStatic memberRemoveByRankRange(String, Int32, Int32, MapReturnType, CTX)
Create map remove operation. Server removes "count" map items starting at specified rank and returns removed data specified by returnType.
Public methodStatic memberRemoveByValue
Create map remove operation. Server removes map items identified by value and returns removed data specified by returnType.
Public methodStatic memberRemoveByValueList
Create map remove operation. Server removes map items identified by values and returns removed data specified by returnType.
Public methodStatic memberRemoveByValueRange
Create map remove operation. Server removes map 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.

Server returns removed data specified by returnType.

Public methodStatic memberRemoveByValueRelativeRankRange(String, Value, Int32, MapReturnType, CTX)
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 returnType.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank) = [removed items]
  • (11,1) = [{0=17}]
  • (11,-1) = [{9=10},{5=15},{0=17}]

Public methodStatic memberRemoveByValueRelativeRankRange(String, Value, Int32, Int32, MapReturnType, CTX)
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 returnType.

Examples for map [{4=2},{9=10},{5=15},{0=17}]:

  • (value,rank,count) = [removed items]
  • (11,1,1) = [{0=17}]
  • (11,-1,1) = [{9=10}]

Public methodStatic memberSetMapPolicy
Create set map policy operation. Server sets map policy attributes. Server returns null.

The required map policy attributes can be changed after the map is created.

Public methodStatic memberSize
Create map size operation. Server returns size of map.
Top
See Also

Reference