Example #1
0
File: zset.go Project: CowLeo/qdb
// ZINCRBY key delta member
func ZIncrByCmd(s Session, args [][]byte) (redis.Resp, error) {
	if v, err := s.Store().ZIncrBy(s.DB(), args); err != nil {
		return toRespError(err)
	} else {
		return redis.NewBulkBytes(store.FormatFloat(v)), nil
	}
}
Example #2
0
File: zset.go Project: CowLeo/qdb
// ZSCORE key member
func ZScoreCmd(s Session, args [][]byte) (redis.Resp, error) {
	if v, ok, err := s.Store().ZScore(s.DB(), args); err != nil {
		return toRespError(err)
	} else if !ok {
		return redis.NewBulkBytes(nil), nil
	} else {
		return redis.NewBulkBytes(store.FormatFloat(v)), nil
	}
}