I am using this file, but its not working. What am I doing wrong
function lines_from(file)
if not file_exists(file) then return {} end
local lines = {}
for line in io.lines(file) do
lines[#lines + 1] = line
end
return lines
end
-- tests the functions above
local file = 'a.txt'
local lines = lines_from(file)
-- iterate all line numbers and delete key
for k,v in pairs(lines) do
redis.call('DEL', v)
end
Is file iteration wrong or keys always needs to be passed in argument. I have 1000 keys to delete Keys dont have any prefix and cant regex as no pattern