I have written aerospike udf that do get and update. But i am getting exception "bad argument #1 to 'pairs' (table expected, got userdata)"
function update_record( record, list_added, list_removed, bin_name)
local store_list = record[bin_name]
-- get a list from database record. Create one if it doesn't exits
if store_list == nil then
store_list = map()
end
local final_map={}
if store_list then
for k, v in pairs(store_list) do
final_map[k] = 1
i = i+1
end
end
end
My Questions are:
does aerospike retrun map(table) and if yes then whether we can use that return value as map(table) inside lua code
If not then what is the best approach to get and store map in aerospike
I want to store map[Integer, Integer] in aerospike bin.