I have just started trying out Aerospike and wanted to check out the UDF feature. I created a file called list.lua in the /usr/local/scripts directory and registered it on the aql prompt on the console. On registering the module, I got a ‘OK, 1 module added’ response.
However when I tried
execute list.push('mylist', 1) on foo.bar where PK = 'srini'
I got a ‘Error: (100) function not found’. I cannot figure out how to solve this problem. Is the file expected to be in a specific directory only??
I am currently using Aerospike Community Edition build 3.5.14 on Ubuntu 14.04
Also the contents of the list.lua file are as follows:
function push(rec, bin, value) local l = rec[bin] if (l == nil) then l = list() end list.prepend(l, value) rec[bin] = l local length = #l if aerospike:exists(rec) then aerospike:update(rec) else aerospike:create(rec) end return length end
Please help if possible…