Method: Aerospike::Exp::Map.get_by_value

Defined in:
lib/aerospike/exp/exp_map.rb

.get_by_value(return_type, value, bin, ctx: nil) ⇒ Object

Create expression that selects map items identified by value and returns selected data specified by return_type.

Examples

# Map bin “a” contains value “BBB” Exp.gt(

MapExp.getByValue(CDT::MapReturnType::COUNT, Exp.val("BBB"), Exp.mapBin("a")),
Exp.val(0))

Parameters:

  • return_type

    metadata attributes to return. See MapReturnType

  • value

    value expression

  • bin

    bin or map value expression

  • ctx (defaults to: nil)

    optional context path for nested CDT

[View source]

353
354
355
356
# File 'lib/aerospike/exp/exp_map.rb', line 353

def self.get_by_value(return_type, value, bin, ctx: nil)
  bytes = Exp.pack(ctx, GET_BY_VALUE, return_type, value)
  add_read(bin, bytes, get_value_type(return_type))
end