Method: Aerospike::Exp::Map.remove_by_key_relative_index_range
- Defined in:
- lib/aerospike/exp/exp_map.rb
permalink .remove_by_key_relative_index_range(key, index, bin, ctx: nil, count: nil) ⇒ Object
Create expression that removes map items nearest to key and greater by index with a count limit if provided.
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]
172 173 174 175 176 177 178 179 |
# File 'lib/aerospike/exp/exp_map.rb', line 172 def self.remove_by_key_relative_index_range(key, index, bin, ctx: nil, count: nil) bytes = if count.nil? Exp.pack(ctx, REMOVE_BY_KEY_REL_INDEX_RANGE, CDT::MapReturnType::NONE, key, index) else Exp.pack(ctx, REMOVE_BY_KEY_REL_INDEX_RANGE, CDT::MapReturnType::NONE, key, index, count) end add_write(bin, bytes, ctx) end |