I have a lua redis script that I want to pass some nil arguments to in ARGV. I figured the following would work:
redis-cli EVAL "$(cat some_script.lua)" 3 key1 key2 key 3 nil nil 4
In that case, I'd expect ARGV[1] = ARGV[2] = nil. Instead, they seem to be set to 'nil' (the string) inside lua, so when I do something like:
if ARGV[1] then return ARGV[1] end
I get 'nil' returned to me.
How do I properly pass nils to Lua?
nilinside the program. Otherwise, you'll always receive a string. - hjpotter92