Hi, I’m looking to use ZINCRBY to change the state of a leaderboard, but without creating a new key because that would add a new key that should have expired. How do I do this? Thank you for your help!
There is no atomic way to do
ZINCRBY only when it exists (as with
SET with the
XX flag). So your best bet is to do an
EXISTS and only run
ZINCRBY if it returns a nonzero value.