MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdZINCRBY

Function cmdZINCRBY

sorted_sets.go:330–346  ·  view source on GitHub ↗
(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

328 }
329
330 // Redis replies with a bulk string here, not an integer reply.
331 return []byte(strconv.FormatInt(n, 10)), nil
332}
333
334func cmdZINCRBY(m uhaha.Machine, args []string) (interface{}, error) {
335 if len(args) != 4 {
336 return nil, uhaha.ErrWrongNumArgs
337 }
338
339 delta, err := strconv.Atoi(args[2])
340 if err != nil {
341 return nil, err
342 }
343
344 n, err := ldb.ZIncrBy([]byte(args[1]), int64(delta), []byte(args[3]))
345 if err != nil {
346 return nil, err
347 }
348
349 return redcon.SimpleInt(n), nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected