You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hmsetck key checkfield checkvalue field1 value1 ...
Semantics are basically (pseudocode):
if (hash->{checkfield} equals checkvalue) {
foreach field in fields list {
hash->{fieldX} = valueX
}
within a hash-value.
This command is a very powerful primitive for Redis use cases that
require versioning of data. It's also much easier to use (since it's a
single command) to avoid races in such use cases than Redis transactions.
If you have strong latency and throughput requirements: Both Redis
transactions and Lua scripts are much more heavy-handed than this
single, fast, atomic command.
The particular use case I have is fast, race-free, versioned session
handling in a cross-datacenter setup, where each session is a hash with
am embedded version. If session updates only required one round-trip
(like with this command) and didn't require running a Lua script, that'd
be a improvement for us.
0 commit comments