support zunionstore in redis (#410)
This commit is contained in:
@@ -51,7 +51,8 @@ type (
|
||||
Pipeliner = red.Pipeliner
|
||||
|
||||
// Z represents sorted set member.
|
||||
Z = red.Z
|
||||
Z = red.Z
|
||||
ZStore = red.ZStore
|
||||
|
||||
IntCmd = red.IntCmd
|
||||
FloatCmd = red.FloatCmd
|
||||
@@ -1394,6 +1395,20 @@ func (s *Redis) Zrevrank(key string, field string) (val int64, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Redis) Zunionstore(dest string, store ZStore, keys ...string) (val int64, err error) {
|
||||
err = s.brk.DoWithAcceptable(func() error {
|
||||
conn, err := getRedis(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
val, err = conn.ZUnionStore(dest, store, keys...).Result()
|
||||
return err
|
||||
}, acceptable)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Redis) String() string {
|
||||
return s.Addr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user