HINCRBY

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Increment or decrement a value by increment

The usage is hincrby key field increment.
If the field does not exist, the increment value is set.

Example

Command>hincrby user-1 visits 1
Result>1
Command>hincrby user-1 visits 5
Result>6
Command>hincrby user-1 visits -10
Result>-4

View animation



Syntax

HINCRBY key field increment

  • Available since version 2.0.0.
  • Time complexity is O(1).
Related commands HSET, HMGET, MSET, LPUSH, SADD, ZSET
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< HSTRLEN HINCRBY HINCRBYFLOAT >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.