I am using Ruby client and facing issues with map modules in aerospike which always return nil value.
I am referring to the documentation map | Developer
local m=map() aerospike attempt to call global ‘map’ (a nil value).
Same is the issue with list,llist etc
Also,I tried using different clients but the issue remains same.
When tried calling map,i get this response
local m=map()
stdin:1: attempt to call global ‘map’ (a nil value)
stack traceback:
stdin:1: in main chunk
[C]: in ?
The issue is clearly with Aerospike extensions to Lua.I want to know where I m getting wrong?
It turned out that the problem was in my udf code only.
I tried running the below udf and now it is working fine.
function readBin(r, name)
local function mapper(rec)
local element = map()
element[name] = rec[name];
return element
end
return mapper(r)
end
Thanks!
Still I have a query.
As ruby client doesn’t support aggregation,is there any way I can use Ruby client to find all activities of a subscriber_key in descending order of timestamp_key where my PK=combination of ( activity_key,timestamp_key) ?
Since the Ruby client currently does not support aggregations, you’ll need to scan the whole set and handle the aggregation logic within your application. You can limit the scan to only return the subscriber_key for each record to minimize data transfer. Also, to ensure you receive the full PK and not just the key hash in the scan results you need to ensure send_key is set to true in the write policy, when the records get created. With the Ruby client, this is the default.