If you get an error that reads “WRONGTYPE Operation against a key holding the wrong kind of value” when using the ZPOPMIN
or ZPOPMAX
commands in Redis, it’s because you’re passing a key with the wrong data type.
The same issue can apply when using the blocking variants of these commands (BZPOPMIN
and BZPOPMAX
).
To fix this issue, make sure you pass a sorted set to these commands.
Continue reading