Skip to content

Commit

Permalink
Merge pull request #35 from qm1004/master
Browse files Browse the repository at this point in the history
add HMGET command
  • Loading branch information
hoisie committed Jan 26, 2014
2 parents b484146 + 2a2ce58 commit 506c7e7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,19 @@ func (client *Client) Hmset(key string, mapping interface{}) error {
return nil
}

func (client *Client) Hmget(key string, fields ...string) ([][]byte, error) {
var args []string
args = append(args, key)
for _, field := range fields {
args = append(args, field)
}
res, err := client.sendCommand("HMGET", args...)
if err != nil {
return nil, err
}
return res.([][]byte), nil
}

func (client *Client) Hincrby(key string, field string, val int64) (int64, error) {
res, err := client.sendCommand("HINCRBY", key, field, strconv.FormatInt(val, 10))
if err != nil {
Expand Down

0 comments on commit 506c7e7

Please sign in to comment.