INCR increments the number stored at the key by 1 (n = n + 1) and returns the new value. If the key does not exist, it will be initialized with zero before applying the operation. If there is an existing value at the key with a non-numeric type (string, bytes, etc.) the operation will throw an erro
(key string)
| 257 | // |
| 258 | // Works similar to https://redis.io/commands/incr |
| 259 | func (c Client) INCR(key string) (after int64, err error) { |
| 260 | return c.INCRBY(key, 1) |
| 261 | } |
| 262 | |
| 263 | // DECR decrements the number stored at the key by 1 (n = n - 1) and returns the new value. If the |
| 264 | // key does not exist, it will be initialized with zero before applying the operation. |