#324·medis

Encoding/Decoding ZSET Scores

Author: rsmckCreated Mar 6, 2026Updated Mar 6, 2026

Sort of following on from https://github.com/luin/medis/issues/292 (which I thought was being implemented, but didn't) it would be good to be able to apply custom encoders/decoders to the scores in a ZSET (and, perhaps keys in hashes etc)

Redis GEO uses ZSET score to encode the location

It's a common convention to use a unix timestamp as a ZSET score etc

It would be good to be able to display these in Medis. You can already encode/decode the Content, so adding the same functionality to Score would seem trivial. Ideally it should also be pinned to the key, so if I set it once it would retain it every time that key is accessed.