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

Function cmdZREMRANGEBYSCORE

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

Source from the content-addressed store, hash-verified

501}
502
503func cmdZREMRANGEBYSCORE(m uhaha.Machine, args []string) (interface{}, error) {
504 if len(args) != 4 {
505 return nil, uhaha.ErrWrongNumArgs
506 }
507
508 min, max, err := zparseScoreRange([]byte(args[2]), []byte(args[3]))
509 if err != nil {
510 return nil, err
511 }
512
513 n, err := ldb.ZRemRangeByScore([]byte(args[1]), min, max)
514 if err != nil {
515 return nil, err
516 }
517
518 if n == -1 {
519 return nil, nil
520 }
521
522 return redcon.SimpleInt(n), nil
523}
524
525func cmdZREMRANGEBYRANK(m uhaha.Machine, args []string) (interface{}, error) {
526 if len(args) != 4 {

Callers

nothing calls this directly

Calls 1

zparseScoreRangeFunction · 0.85

Tested by

no test coverage detected