1.0.0 • Published 10 years ago

redis-getcmpset v1.0.0

Weekly downloads
4
License
ISC
Repository
-
Last release
10 years ago

This package is a Redis Lua command, to be used with redis-require.

Install it with npm install redis-getcmpset.

GETCMPSET key oldValue newValue

Time complexity: O(1)

Sets key to newValue if the current value equals oldValue. Returns the value originally stored at key. If the set succeeded, the return value will be oldValue. Returns an error when key exists but does not hold a string value.

Return value

Bulk string reply: the value that was stored at key.