Fritzy.io

Redis Lua: Updating a Key and Lookup Hash

redislua

Yesterday I mentioned that you should maintain a lookup hash as you update keys.

So today, I decided to put that together.
The only real gotcha is deleting the lookup to the old attribute value before updating the lookup hash.

Largely the same caviates apply as yesterday.
We could flesh this out to handle many attributes and attributes deeper than the root.
Again, this assumes that each attribute will only exist in one key per lookup hash.