MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / INCRBY

Method INCRBY

strings.go:287–294  ·  view source on GitHub ↗

INCRBY increments the number stored at the key with the given delta (n = n + delta) 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 operat

(key string, delta int64)

Source from the content-addressed store, hash-verified

285//
286// Works similar to https://redis.io/commands/incrby
287func (c Client) INCRBY(key string, delta int64) (after int64, err error) {
288 rv, err := c.incr(key, IntValue{delta})
289 if err == nil {
290 after = rv.Int()
291 }
292
293 return
294}
295
296// DECRBY decrements the number stored at the key with the given delta (n = n - delta) and returns the new value. If the
297// key does not exist, it will be initialized with zero before applying the operation.

Callers 4

INCRMethod · 0.95
DECRMethod · 0.95
DECRBYMethod · 0.95
TestCountersFunction · 0.80

Calls 2

incrMethod · 0.95
IntMethod · 0.80

Tested by 1

TestCountersFunction · 0.64