Method: Aerospike::CDT::MapOperation.remove_by_key_rel_index_range

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

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

Create map remove by key relative to index range operation.

Server removes map items nearest to key and greater by relative index, with a count limit.

Server returns removed data specified by return_type.

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]

Without count:

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



298
299
300
301
302
303
304
# File 'lib/aerospike/cdt/map_operation.rb', line 298

def self.remove_by_key_rel_index_range(bin_name, key, index, count = nil, ctx: nil, return_type: nil)
  if count
    MapOperation.new(Operation::CDT_MODIFY, REMOVE_BY_KEY_REL_INDEX_RANGE, bin_name, key, index, count, ctx: ctx, return_type: return_type)
  else
    MapOperation.new(Operation::CDT_MODIFY, REMOVE_BY_KEY_REL_INDEX_RANGE, bin_name, key, index, ctx: ctx, return_type: return_type)
  end
end