Returns | New counter value if found, otherwise nil |
---|---|
Keys |
|
Args |
|
> evalsha 3cb0d65c399fda8a1d4eb93b2fe85311671bc969 1 guests sally 1 (nil) > hset guests sally 8 (integer) 1 > evalsha 3cb0d65c399fda8a1d4eb93b2fe85311671bc969 1 guests sally 1 (integer) 9 > evalsha 3cb0d65c399fda8a1d4eb93b2fe85311671bc969 1 guests sally 1 (integer) 10
if redis.call("HEXISTS", KEYS[1], ARGV[1]) == 1 then return redis.call("HINCRBY", KEYS[1], ARGV[1], ARGV[2]) else return nil end
3cb0d65c399fda8a1d4eb93b2fe85311671bc969
← More scripts from the Memetria Library
All scripts on this site are in the public domain, unless otherwise noted, and are provided without warranty express or implied. Memetria make no claim for the effectiveness, safety, security or quality of the scripts contained within.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.