CDT::ListOperation.get_by_rank, wrong number of arguments (given 3, expected 2)

#1

Hi, I am trying to get minimum and maximum value of some list, and I was looking for example of timeseries, and I am trying to use something like this:

op_size = [CDT::ListOperation.get_by_rank('data',-1,7)]

but got ArgumentError (wrong number of arguments (given 3, expected 2))

In documentation https://www.rubydoc.info/gems/aerospike/Aerospike%2FCDT%2FListOperation.get_by_rank it states that 3 parameter is return type, but I got error. What am I doing wrong? Thank you

#2

The return_type is a keyword argument, so you need to call the method like this:

CDT::ListOperation.get_by_rank('data', -1, return_type: CDT::ListReturnType::VALUE)

Or using this alternative syntax:

CDT::ListOperation.get_by_rank('data', -1).and_return(CDT::ListReturnType::VALUE)
#3

Ah, I understand, thank you, will try