redis - What is the return type of HGETALL in Lua -
I am writing a script and my script is:
local session = redis. Call ('HGETALL', AccessToken) if (session == zero) redis.log (redis.LOG_WARNING, 'session not found:' accesstooken) end of return
I tried several Situations and if I do not know how exactly is valid if the value is zero. Besides, I do not want to call the EXISTS command upwards.
I tried to call it through telnet and react with redis * 0
This list I tried:
If (session == zero) then (session == '[]') then if (session == '{}') then if (session == '* 0') then if (session == ' ') Then if (session ==' (empty list or set) ') then if (not session) then
None are working from these situations, anyone has an idea is?
Some quick searches seem to suggest online that HGETALL
(and other functions Which return the key / value pair) is a table of sequential key / value pairs. Then {"key1", "val1", "key2", "val2"}
.
This indicates that empty results (that zero
) will be an empty table (i.e. session [1] == zero
).
Comments
Post a Comment