1.0.4 • Published 10 years ago
redis-getsetnx v1.0.4
This package is a Redis Lua command, to be used with redis-require.
Install it with npm install redis-getsetnx
.
GETSETNX key value
Time complexity: O(1)
Idempotently, atomically sets key
to value
if key
does not have a different value already.
Returns the value stored at key
. If the set succeeded or key
was already set to value
, the return value will be value
.
Returns an error when key exists but does not hold a string value.
Return value
Bulk string reply: the value now stored at key
.