My plan is to store some existing Redis keys in a hash, that would be later fetched from within a Redis Lua script and acted upon. I read that it is best practice to provide all keys that are used in a script when invoking EVAL
.
My question is, is it safe to run a script that doesn't have any keys provided when running EVAL
, but operates on some keys that are fetched from within the script? If not, what are the consequences and how can I avoid this shortcoming?
I mention that at the time of EVAL
, there is no way of knowing what the keys in that specific hash are. I can get all the keys from the hash in a step prior to EVAL
, then provide them to EVAL
, but that sounds like overkill.