Method: Aerospike::CDT::MapOperation.remove_by_value_rel_rank_range

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

.remove_by_value_rel_rank_range(bin_name, value, rank, count = nil, ctx: nil, return_type: nil) ⇒ Object

Create map remove by value relative to rank range operation.

Server removes “count” map items nearest to value and greater by relative rank. If “count” is not specified, server removes map items nearest to value and greater by relative rank, until the end of the map.

Server returns removed data specified by return_type.

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]

Without count:

  • (value, rank) = [removed items]

  • (11, 1) = [0=17]

  • (11, -1) = [9=10, 5=15, 0=17]



380
381
382
383
384
385
386
# File 'lib/aerospike/cdt/map_operation.rb', line 380

def self.remove_by_value_rel_rank_range(bin_name, value, rank, count = nil, ctx: nil, return_type: nil)
  if count
    MapOperation.new(Operation::CDT_MODIFY, REMOVE_BY_VALUE_REL_RANK_RANGE, bin_name, value, rank, count, ctx: ctx, return_type: return_type)
  else
    MapOperation.new(Operation::CDT_MODIFY, REMOVE_BY_VALUE_REL_RANK_RANGE, bin_name, value, rank, ctx: ctx, return_type: return_type)
  end
end