Method: Aerospike::CDT::MapOperation.get_by_key_rel_index_range

Defined in:
lib/aerospike/cdt/map_operation.rb

.get_by_key_rel_index_range(bin_name, key, index, count = nil, ctx: nil, return_type: nil) ⇒ Object

Create map get by key relative to index range operation.

Server selects “count” map items nearest to key and greater by relative index. If “count” is not specified, server selects map items nearest to key and greater by relative index, until the end of the map.

Server returns selected data specified by return_type.

Examples for 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]

Without count:

  • (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]



510
511
512
513
514
515
516
# File 'lib/aerospike/cdt/map_operation.rb', line 510

def self.get_by_key_rel_index_range(bin_name, key, index, count = nil, ctx: nil, return_type: nil)
  if count
    MapOperation.new(Operation::CDT_READ, GET_BY_KEY_REL_INDEX_RANGE, bin_name, key, index, count, ctx: ctx, return_type: return_type)
  else
    MapOperation.new(Operation::CDT_READ, GET_BY_KEY_REL_INDEX_RANGE, bin_name, key, index, ctx: ctx, return_type: return_type)
  end
end