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

Method DECR

strings.go:273–275  ·  view source on GitHub ↗

DECR decrements 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)

Source from the content-addressed store, hash-verified

271//
272// Works similar to https://redis.io/commands/decr
273func (c Client) DECR(key string) (after int64, err error) {
274 return c.INCRBY(key, -1)
275}
276
277// INCRBY increments the number stored at the key with the given delta (n = n + delta) and returns the new value. If the
278// key does not exist, it will be initialized with zero before applying the operation.

Callers 1

TestCountersFunction · 0.80

Calls 1

INCRBYMethod · 0.95

Tested by 1

TestCountersFunction · 0.64