I hate to see great posts fall between the cracks on HN. This announcement was worth re-posting. I missed the original announcement and only just discovered the json module this morning. It looks like a really valuable addition. I'm using hashes in ways I won't need to anymore by adopting it.
No disrespect Matthew, but you're doing it very very wrong.
Very #1: do not use `KEYS`, use `SCAN` instead. Your script is not only blocking the server, it also consumes a lot of RAM just for holding them while iterating.
Very #2: do not use JSON to encode, and no need for the conditional-read-by-type - just use Redis' `DUMP`