Skip to content

Commit

Permalink
Update redis.go
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinu2 committed Nov 7, 2022
1 parent 44a10e5 commit b21303e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ func (c *Cacher) HMSet(key string, val interface{}, expire int) (err error) {
return
}

// HMGet HMGet(keys, fields)
func (c *Cacher) HMGet (key string, fields []string) ([]string, error) {
return redis.Strings(c.Do("HMGET", c.getKey(key), fields))
}

/** Redis hash 是一个string类型的field和value的映射表,hash特别适合用于存储对象。 **/

// HSet 将哈希表 key 中的字段 field 的值设为 val
Expand Down

0 comments on commit b21303e

Please sign in to comment.