在redis-cli.exe --eval test.lua
运行以下脚本后,get foo
仍会打印1。
local current = redis.call('GET', 'foo')
-- I have also tried current = redis.call('GET','foo').ok
if current == 1
then redis.call('SET', 'foo', 2)
end
if current == '1'
then redis.call('SET', 'foo', 3)
end